SMTP send e-mail

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I know there are lots of threads covering my question but i am still unable
to send e-mails from an asp.net page. Messages are not even going into the
logs.

Here is the code that i am using to send the e-mail.

MailMessage objMail = new MailMessage();
objMail.From = "nigel@***";
objMail.To = nigel@***;
objMail.Subject = txtSubject.Text;
objMail.BodyFormat = MailFormat.Html;
objMail.Body = "Text"
SmtpMail.SmtpServer = "127.0.0.1";
SmtpMail.Send(objMail);

The error that i am getting is

System.Runtime.InteropServices.COMException: The message could not be sent
to the SMTP server. The transport error code was 0x800ccc15. The server
response was not available

Line 22: SmtpMail.Send(objMail);

The server is a Windows 2003 running iis 6.0 and smtp. I have set the realy
to 127.0.0.1 but to no avail.

One thing that i have noticed is that i cannot telnet to port 25. I have no
firewall enabled yet and no antivirus.

Does anyone have any suggestions?

Thanks in advance

Nigel
 
I would hazard a guess that your expecting your smtp instance to handle your
email - but your local SMTP is not an SMTP gateway, only a forwarding device
to a gateway like an exchange server or ISP email server on port 25. That
would explain why you cant get a response from port 25.

Cant remember the exact details - but you need to try setting the smart host
option of your smtp under IIS to point to an accesible smtp server.
 
Back
Top