Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

1 solution

The suggestion is to use Explicit security.

The following Code implementing Explicit Security resolved the issue.

Smtp1.Session.Security.Encrypt = Encrypt.Explicit
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900