【发布时间】:2017-06-13 19:26:48
【问题描述】:
错误是 SMTP 服务器需要安全连接或客户端未通过身份验证。服务器响应是: 5.7.0 必须首先发出 STARTTLS 命令。 t77sm26908892pfg.102 - gsmtp
Dim SmtpServer As New SmtpClient()
Dim mail As New MailMessage()
SmtpServer.Port = 587
SmtpServer.Host = "smtp.gmail.com"
SmtpServer.Credentials = New _
Net.NetworkCredential("user@gmail.com", "user1")
mail = New MailMessage()
mail.From = New MailAddress("user@gmail.com")
mail.To.Add("user2@gmail.com")
mail.Subject = "Test Mail"
mail.Body = "This is for testing SMTP mail from GMAIL"
SmtpServer.Send(mail)
MsgBox("mail send")
【问题讨论】:
-
UseSSL true, theres a property to ssl;将其设置为 true...
-
在我的代码中没有 ssl
-
谢谢先生重播
标签: vb.net