是否可以通过发送应用谷歌的电子邮件没有SSL证书? [英] Is it possible to send an email via google apps without an ssl cert?
问题描述
我想通过谷歌应用程序从我的asp.net应用程序发送电子邮件和我得到了以下异常:
I'm trying to send email via google apps from my asp.net app and am getting the following exception:
{SMTP服务器要求安全连接或客户端未通过身份验证服务器响应为:5.5.1需要验证了解更多}
{"The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at "}
我的web.config具有以下值(抱歉,我不能让XML显示):
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>
我在想,我没有一个SSL证书,但我不知道这是因为。有什么想法?
I'm thinking that this is due to my not having an SSL cert but I'm not sure. Any thoughts?
推荐答案
我有工作这种方式与我们的Gmail帐户中的一个(code是简化):
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
您可以尝试用此code和配置发送电子邮件只是为了看看如果您收到相同的错误消息。
You could try to send an email with this code and your configuration just to see if you receive the same error message.
这篇关于是否可以通过发送应用谷歌的电子邮件没有SSL证书?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!