【发布时间】:2015-05-24 23:23:55
【问题描述】:
当我尝试使用 VB.Net 或 C# 使用 Gmail 发送电子邮件时,我不断收到以下消息:发送电子邮件失败 - 尝试以访问权限禁止的方式访问套接字 - 无法远程访问服务器。 我曾尝试使用多个 Gmail 帐户,包括过去有效的 VB.Net 代码,如下所示:
Message = New MailMessage(Sender, Recipient, Subject, MessageBody)
SMTPServer = New SmtpClient("smtp.gmail.com", 587)'Port 465 fails as well
SMTPServer.EnableSsl = True
SMTPServer.Credentials = New NetworkCredential("Username@gmail.com", "password")
SMTPServer.Send(Message)
(我知道 web.config 可用于上述很多方面)。
显然 Gmail 一定更改了某些设置或类似的东西?
【问题讨论】:
-
关闭防火墙再试一次。
-
我尝试关闭防火墙,但没有任何影响。