I am using the SMTPsecureSocket for sending email. This results in an error message that states
Error 530 5.7.0 Must issue a STARTTLS command first.
What are the proper settings to avoid this error? Is there an example code somewhere for avoiding the TLS errors?
I have been using the SMTPsocket (with Real Studio 2012R2.1) successfully before the use of SSL was required.
To answer Phillip: Yes I’m using the SMTPsecureSocket.
I have the following code:
There is an SMTPsecureSocket named sendSocket on my active window.
In a “send” button’s action event I have
sendSocket.Address = my SMTP server name
sendSocket.Username = my SMTP user name
sendSocket.Password = my password
sendSocket.Port = 465
sendSocket.ConnectionType = 3
sendSocket.Secure = True
I use a standard SMTPsocket called MailSocket and send the mail with the following Subroutine.
Sub SendTheMail
Parameters strTo As String, strSubject As String, strBody As String
dim mail as emailMessage
dim SMTP_Provider, SMTP_User, SMTP_Pass, SMTP_From As string
dim SMTP_Port As Integer
SMTP_Provider = // This is your SMTP provider
SMTP_Port = 1025
SMTP_User = // Your account at the SMTP provider
SMTP_Pass = // Your password
SMTP_From = // Email from
// set up the socket
MailSocket.address = SMTP_Provider
MailSocket.port = SMTP_Port
MailSocket.username = SMTP_User
MailSocket.password = SMTP_Pass
// populate the email message
mail = new emailMessage
mail.fromAddress = SMTP_From
mail.subject = strSubject
mail.bodyPlainText = strBody
// add recipients
mail.addRecipient strTo
// send the email
MailSocket.messages.append mail
MailProgress.visible = true
MailSocket.sendMail
You don’t seem to understand the situation. Some SMTP servers use a protocol called STARTTLS. The client does not have a choice of not using it when the email server is using it.
The Xojo SMTP sockets will not work with those SMTP email servers because it was not fully developed to handle those SMTP email servers.
I’m guessing the Xojo engineer wasn’t aware of those types of SMTP email servers/protocol so I’m guessing it was overlooked.
That means if your email server or your client’s email server uses the STARTTLS protocol you cannot use the built in Xojo SMTP sockets. You need to code your own SMTP socket or purchase someone else’s which can handle the STARTTLS protocol.
You are correct for email servers not using the STARTTLS protocol the Xojo SMTP sockets seem to work well and I use them.
Please something more simple for beginners or amateurs who could build an application of automated test for students which mails results to the teacher. With the server of my university I can send such mails via gmail smtp but not via University smtp, which doesn’t support “plain” authentication type, only login type.
Language reference says "SMTPSocket supports the ‘login’ authentication type as well as ‘plain.’ ", but…
Thanks