I have set up the SMTP server in Windows Server 2012.
I have made sure it is running.
Putting a txt file in mailroot pickup folder is sending email.
The code is sending email in local Windows 7 computer.
I also set up SMTP in IIS 7.
MailMessage mail = new MailMessage("saimanti.das@lahey.org", "saimanti.das@lahey.org");
SmtpClient client = new SmtpClient();
client.Port = 25;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = false;
client.Host = "relaysmtp.lahey.org";
mail.Subject = "this is a test email.";
mail.Body = "this is my test email body";
client.Send(mail);
This was really not an issue of SMTP. SMTP was working. There was a bug in my code where I was not catching the IIS 8.0 instance.
Thanks fot your help and this site is really good.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.