Windows firewall is off and the network firewall is not blocking outbound ports.
What else should I look for?
IIS 7 on Win2k8, using ASP.NET w/ C#
SmtpClient smtpClient = new SmtpClient();
smtpClient.EnableSsl = true;
smtpClient.Send(fromAddress, toAddress, subject, body);
wrap smtpClient.Send(fromAddress, toAddress, subject, body);
inside a try catch statment and see what the exception is
Gmail requires authentication from the SMTP client, so you need to fill in the Credentials
property on your SmtpClient
instance as shown here .
That doesn't explain why it works from your development box (unless the POP3 method still works) but it would explain why the code you have shown doesn't work.
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.