当我尝试与使用Gmail VB.Net或C#我不断收到以下消息发送电子邮件:不发送电子邮件 - 试图访问一个插座以其访问权限禁止的方式 - 无法访问远程服务器。 我一直在使用Gmail的几个帐户尝试包括在过去的工作VB.Net代码,如下所示:与Gmail和C#发送电子邮件/ 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("[email protected]", "password")
SMTPServer.Send(Message)
(据我所知,在web.config可用于很多以上)。
显然Gmail中必须更改了某些设置或类似的东西?
关闭防火墙并重试。 – Jashwant 2012-01-28 10:56:24
我试图关闭防火墙,但没有任何区别。 – Lee 2012-01-28 11:05:35