I have an ASP.NET program that sends a confirmation email with the following code:
String msgTxt = "My Message";
try
{
MailMessage message = new MailMessage();
message.From = new MailAddress("[email protected]");
message.To.Add(new MailAddress(emailParam));
message.Bcc.Add(new MailAddress("[email protected]"));
message.Subject = "Your Nutrition Prescription";
message.Body = msgTxt;
SmtpClient client = new SmtpClient();
client.Send(message);
}
catch (Exception ex)
{
}
The web.config
file has this:
<system.net>
<mailSettings>
<smtp>
<network
host="localhost"
port="25" />
</smtp>
</mailSettings>
</system.net>
And my IIS is set to run on Port 25 (I can telnet in and test it, and it sends just fine by telnet).
Can someone direct me somewhere else to look for the problem?