View Single Post
  #3 (permalink)  
Old September 7th, 2003, 04:21 PM
Imar's Avatar
Imar Imar is offline
Wrox Author
Points: 65,681, Level: 100
Points: 65,681, Level: 100 Points: 65,681, Level: 100 Points: 65,681, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 15,966
Thanks: 64
Thanked 1,349 Times in 1,329 Posts
Default

Hi there,

You may need to set the SMTP server explicitly. I believe it defaults to localhost (that's why it works on your local machine). Apparently, the server your page runs on does not have an SMTP server installed, so it can't send the mail using localhost.

Try this:
Code:
SmtpMail.SmtpServer = "smtp.YourProvider.com";
SmtpMail.Send(objMail);
or in your case since you're not using a using statement (no pun intended):
Code:
System.Web.Mail.SmtpMail.SmtpServer = "smtp.YourProvider.com";
System.Web.Mail.SmtpMail.Send(objMail);
This will force the ASP page to send the e-mail to the smtp.YourProvider.com server.

HtH,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote