Question
· Sep 26, 2023

How to use SMTP protocol with TLS and SSLConfiguration

Hi All,

In the below code, How to Add SSLConfiguration and TLS. Please advise.

My sample code.

set s=##class(%Net.SMTP).%New()
;set auth=##class(%Net.Authenticator).%New() 
;set auth.UserName=[["myUser"]]
;set auth.Password=[["myPassword"]]
;set s.authenticator=auth
set s.smtpserver="relay.abc.com"
set s.timezone="-0400" 
set m=##class(%Net.MailMessage).%New()
set m.From="test@company.com"
do m.To.Insert("kumars@test.com")
do m.To.Insert("test1@another.com")
set m.Subject="Test IRIS mail 1"  
do m.TextData.Write("This message has been sent using an SMTP server ")
set status=s.Send(m)
if 'status do $system.OBJ.DisplayError(status)
Q
Product version: IRIS 2023.1
Discussion (3)1
Log in or sign up to continue