views:

46

answers:

2
  • My config files are identical, except for connection strings.
  • I'm using IIS on both machines
  • I elevated the IIS user on the server to ensure it's not a permissions issue
  • No exceptions are thrown on my server where the e-mails are not being sent
  • I know the gmail configs are correct because I can send e-mails from my dev box.
  • 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);
A: 

wrap smtpClient.Send(fromAddress, toAddress, subject, body); inside a try catch statment and see what the exception is

Yassir
I intentionally didn't catch any exceptions on that web page so that I could see the exception bubble up, but none did. As far as I can tell, no exception was thrown.
drewbu
A: 

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.

GraemeF