Is it possible to send an email via google apps without an ssl cert?
I'm trying to send email via google apps from my asp.net app and am getting the following exception:
{"The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentica开发者_如何学Gotion Required. Learn more at "}
My Web.config has the following values (sorry I couldn't get the XML to display):
<system.net>
<mailSettings>
<smtp from="user@domain.com"
deliveryMethod="Network">
<network host="smtp.gmail.com"
port="587"
userName="user@domain.com"
password="password"
enableSsl="true"/>
</smtp>
</mailSettings>
</system.net>
I'm thinking that this is due to my not having an SSL cert but I'm not sure. Any thoughts?
I have it working this way with one of our gmail account (code is simplified):
SmtpClient client = new SmtpClient("smtp.gmail.com", "smtp.gmail.com");
client.EnableSsl = true;
client.Credentials = new NetworkCredential(userName, userPassword);
client.Send(mail); // mail is of type System.Net.Mail.MailMessage
You could try to send an email with this code and your configuration just to see if you receive the same error message.
Your code should work fine; I use the exact same configuration successfully.
You may have a firewall issue.
精彩评论