Page 1 of 1

Outlook 365 email requires "starttls = true" parameter

Posted: 4 Feb 2018 18:52
by larryhoughton
Update: GoDaddy has given me a port 25 option that may be a work-around for now....

I need to include email output in my VP application. "" was perfect right up to point where I found out the GoDaddy Outlook 365 smtp server I'd like to use requires a setting that the VP sendMail doesn't have; starttls = true.


Part of the fun is the username and password have to be encrypted like so:
C:\OpenSSL\bin>echo|openssl enc -base64

The way things are now I don't get the chance to use the encrypted Username or Password; the Outlook 365 server errors out with:

Code: Select all

eMail Token: 220 Message=:EHLO eMail Token: 250 AUTH LOGIN hjashjifhasfhjsa (I send AUTH LOGIN and the encrypted email Username) eMail Token: 504 (and get back 504 unrecognized authentication type) ========================================  Dump: 2018-02-04 10:20:18 ---------------------------------------- Exception: sendMailException (sendMail_smtp)  Continued exception in sendMail package  Predicate name = readLine  SourceCursor = pfc\web\sendMail_smtp\,13)  Server Response = 504 5.7.4 Unrecognized authentication type [] raised 2018-02-04 10:20:18 ThreadId: 6100 Class name: sendMail_smtp Predicate name: readLine

Here is the pertinent code to recreate the error. It includes slight modification/addition to have send "AUTH LOGIN" to Outlook 365:

Code: Select all

constants username="kjhkhjaskfhh the encrypted Username". password="sgdsf25gfsfg the encrypted password". predicates     sendEmail : (socket Socket). clauses     sendEmail(SOCKET) :-     Message_AUTH_LOGIN = string::concat("AUTH LOGIN ", username,"\r\n"),     msglayer::msglay_WriteStr(SOCKET,  Message_AUTH_LOGIN),     stdio::write(Message_AUTH_LOGIN),     readLine(SOCKET),   %The 504 error has already occurred at this point....       Message_Password = string::concat(password, "\n"),     msglayer::msglay_WriteStr(SOCKET, Message_Password),     stdio::write(Message_Password),     readLine(SOCKET),       Message_MAIL_FROM = string::concat("MAIL FROM:","", "\r\n"),     msglayer::msglay_WriteStr(SOCKET, Message_MAIL_FROM),     stdio::write(Message_MAIL_FROM,"\n"),     readLine(SOCKET),    
What can we do??

Re: Outlook 365 email requires "starttls = true" parameter

Posted: 5 Feb 2018 10:57
by Thomas Linder Puls
My immediate reaction is: "starttls=true" sounds like the communication must use a secure (=encrypted) socket connection. And the SMTP layer does not support that.

Re: Outlook 365 email requires "starttls = true" parameter

Posted: 5 Feb 2018 16:19
by larryhoughton
Yes, startttls is SSL. I'm not sure if the requirement is only an encrypted username and password or if the entire "session" has to be SSL (and therefore SSL certificates would be required too, ugh).
The mission is to simply send emails from a Amazon AWS hosted EC2 server running VP.
Amazon's eMail service requires SSL so I bought a GoDaddy email account which has a non SSL option on port 25, however that option uses the sources' IP or domain for authentication and so far I haven't been able to get that to work (since I'm not hosted at GoDaddy).

Re: Outlook 365 email requires "starttls = true" parameter

Posted: 6 Feb 2018 14:12
by Thomas Linder Puls
SSL is acronym for Secure Socket Layer. And TLS for Transport Layer Security.

You can safely assume that it is not just username/password, but the entire communication.

Re: Outlook 365 email requires "starttls = true" parameter

Posted: 20 Mar 2018 6:15
by creiglee
I actually have used a simpler method that seems to work for us:


SMTP server port: 587

Encryption: TLS

And of course use an O365 account with a license for Exchange.

We use it for a few tools and haven't had any issue yet, but it may not be what you need - just throwing it out there.