Good Morning!!!,
I need some clarification for sending mail using SMTP,Actually we run the code in Cache, we are getting the error (ERROR #6029: Timed out waiting for response.1) while run the below code.
Whenever I tried to connect my SMTP server via Telnet (Unix Server),Its working fine and mail also sent successfully which I mentioned the mail id ,Please find the attached screen shot for the mail sent via Telnet
I have checked the GetResponse Method in %Net.SMTP class, it timeout at below code
read response:timeout
else do ..SetStatus($$$ERROR($$$SMTPTimeout)) set response=""
We don’t know why it’s not fetching the response code. Please provide your suggestion.
There is no firewall setting and we are able send mail using Unix Command using the same SMTP and Port number 25 but not from Cache.
Code :
new auth,m,s,status
set s=##class(%Net.SMTP).%New()
set s.smtpserver="xx.xx.xx.xx"
set s.port=25
set auth=##class(%Net.Authenticator).%New() ; use default authentication list
set auth.UserName="pandiyan@xxx.com"
set auth.Password="xxxx@"
set s.authenticator=auth
set m=##class(%Net.MailMessage).%New()
set m.From="pand...@xxx.com"
do m.To.Insert("skumara@xxx.com")
set m.Subject="Sent by Cache' mail"
do m.TextData.Write("This message has been sent using an SMTP server with Authemtication.")
set status=s.Send(m)
w !,$system.OBJ.DisplayError(status)
quit
Thanks & Regards,
Pandiyan