PDA

View Full Version : sending mail through SMTP


sugeet_s
05-04-2006, 02:19 PM
I tried the following code but it gives exception------> The transport failed to connect to the server.

try
{
MailMessage mail = new MailMessage();



mail.To = "sugeet_sharma@infosys.com";



mail.From = "sugeet_sharma@infosys.com";

mail.BodyFormat = MailFormat.Text;


mail.Subject = "harsh";



mail.Body = "Hi";



SmtpMail.SmtpServer = "172.25.150.7";



SmtpMail.Send(mail);
}
catch (Exception ex)
{
Response.Write(ex.Message);

}

:eek: thanks in advance:thumbsup:

jak0b
05-04-2006, 10:47 PM
1) check smtp server configuration, restrictions...
2) does server need authorization?
3) what smtp server u use? build-in IIS or external?

sugeet_s
05-05-2006, 05:08 AM
1)check smtp server configuration, restrictions...
ANS: checked permission granted to the loopback:confused:
2) does server need authorization?
ANS: NO
3) what smtp server u use? build-in IIS or external?
ans: BUILD-IN IIS