问题描述
我正在尝试使用Dart Control发送邮件。它与特定的服务器运行良好,但当我切换到安全的服务器时,我收到以下错误消息。下面是使用的代码和错误信息。
Dim Smtp1 As Smtp =新Smtp Dim SMTPResult As SmtpResult
昏暗消息为Dart.Mail.MailMessage =新Dart.Mail.MailMessage()
Smtp1.Session.RemoteEndPoint.Port = intPortNo
strErrLoc =" SMTP1.DnsServerTimeout"
Smtp1.DnsServerTimeout = 15'默认超时30秒
strErrLoc ="设置用户名"
Smtp1.Session.Username = strUserID
Smtp1.Session.Password = strPWD
strErrLoc =" Subject and Mail TEXT"
留言.Subject = strSubject
如果strHTMLEmail.Trim =""然后
Message.Text = strMailText
Else
Message.Html = strHTMLEmail
结束如果
Smtp1.Session.Authentication = Authentication.Auto
Smtp1.Session.RemoteEndPoint.HostNameOrAddress = strServerName.Trim
Smtp1.Session.ServicePrincipleName =" SMTP /" &安培; strServerName.Trim
SMTPResult = Smtp1.Send(消息)
错误:协议异常 - 请求:AUTH LOGIN响应:530必须首先发出STARTTLS命令
I'm trying to send a mail using Dart Control. It was working well with a particular server, but when i switch to a secured server, I receive the following error message. Below is the code used and the Error message.
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)
ERROR: Protocol Exception-- Request: AUTH LOGIN Response: 530 Must issue a STARTTLS command first
这篇关于无法发送邮件(VB.net)Dart控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!