我想用Dart Control发送邮件。它是用一个特定的服务器运行良好,但自从我切换到一个安全的服务器,我收到以下错误信息:无法发送邮件(VB.net)
协议Exception-- 请求:AUTH LOGIN 响应:530必须发出STARTTLS命令第一
下面是代码:
Dim Smtp1 As Smtp = New Smtp
Dim SMTPResult As SmtpResult
Dim Message As Dart.Mail.MailMessage = New Dart.Mail.MailMessage()
Smtp1.Session.RemoteEndPoint.Port = intPortNo
strErrLoc = "SMTP1.DnsServerTimeout"
Smtp1.DnsServerTimeout = 15 'default time out 30 seconds
strErrLoc = "Set User Name"
Smtp1.Session.Username = strUserID
Smtp1.Session.Password = strPWD
strErrLoc = "Subject and Mail TEXT"
Message.Subject = strSubject
If strHTMLEmail.Trim = "" Then
Message.Text = strMailText
Else
Message.Html = strHTMLEmail
End If
Smtp1.Session.Authentication = Authentication.Auto
Smtp1.Session.RemoteEndPoint.HostNameOrAddress = strServerName.Trim
Smtp1.Session.ServicePrincipleName = "SMTP/" & strServerName.Trim
SMTPResult = Smtp1.Send(Message)