Cache 2010.1 and Office 365 SMTP Relay

Does anyone have any experience with getting, unfortunately, an older version of Cache to authenticate via SMTP to send email? I have verified that the settings are set up properly on the mailbox as I have successfully sent an email from a LAMP server, which comes from the same IP address.

If you have any thoughts, I would greatly appreciate it.

 

This is the error I receive

ERROR #6034: SMTP server connection failed during MAIL FROM command: <READ>zSend+105^%Net.SMTP.1.

when I run the following.

S() Public {
server=##class(%Net.SMTP).%New()
server.smtpserver="smtp.office365.com"
server.port="587"

auth=##class(%Net.Authenticator).%New()
auth.UserName="user@sender.com"
auth.Password="pa$$word"
server.authenticator=auth

message=##class(%Net.MailMessage).%New()
message.From="user@sender.com"
message.To.Insert("user@receiver.com")
message.Subject="Sent by Cache mail"
message.Charset="iso-8859-1"
message.TextData.Write("This message has been sent using an SMTP server with Authentication.")

status=server.Send(message)
($$$ISERR(status)) {

server.Error
$$$ERROR()

}

}

  • 0
  • 0
  • 1029
  • 3
  • 3

Answers

Things to consider

Does the SMTP server require SSL/TLS?

Are there any restrictions as to who can connect to the server.  Eg, white listed IP addresses?

The IP address was the same coming from both servers. I did this to ensure this wasn't an issue.

In regards to the TLS, this is required.

As far as I know office365.com requires STARTTLS that is supported as UseSTARTTLS property of %Net.SMTP starting with Cache 2010.2

Maybe this could help.

We add an extra SMTP-connector in Office 365 allowing e-mail to be send from all of our servers based on their WAN-address.

It uses plain simple SMTP over port 25.

Comments

It's been a while since I posted this. However, we have since upgraded to 2015.2 and we're receiving the above error when we put the correct settings in Task Manager Email Settings.

Is anyone successfully sending emails via SMTP with Office 365/Exchange Online?

Task Manager Email facility supports plain authentication only, despite %Net.SMTP supports it for ages. That's true up to 2017.2, not sure about more recent version (2018.1). Therefore if you need STARTTLS or other SSL/TLS stuff you need to write your own eMail notificator for your task(s).