Reg: SMTP server connection failed during init command

1,245 views
Skip to first unread message

PANDIYAN

unread,
Sep 25, 2016, 10:42:13 AM9/25/16
to Caché, Ensemble, DeepSee
Hi All,

I am trying to send a mail by using smtp.gmail.com,
        I got this this error ERROR #6034: SMTP server connection failed during init command: <READ>zGetResponse+5^%Net.SMTP.1.

Can you please let me know what's the problem over here? or Any other code is there by using SMTP?  

set s=##class(%Net.SMTP).%New()
set auth=##class(%Net.Authenticator).%New() ; use default authentication list
set auth.UserName="pandi...@gmail.com"
set auth.Password="xxxxxxx"
set s.authenticator=auth
set s.smtpserver="smtp.gmail.com"
set s.port=465
set m=##class(%Net.MailMessage).%New()
set m.From="pandi...@gmail.com"
do m.To.Insert("pandi...@gmail.com")
set m.Subject="Test mail"
do m.TextData.Write("Testing Mail's")
set status=s.Send(m)
if $$$ISERR(status) do $system.OBJ.DisplayError(status)
quit

Regards,
Pandiyan

Dmitry Maslennikov

unread,
Sep 25, 2016, 10:55:44 AM9/25/16
to Caché, Ensemble, DeepSee
First what I see, you set port 465, which works only with SSL, but I don't see SSLConfiguration in your code.
You should create empty SSL Configuration, programmatically or manually in Management Portal, does not matter, and name of this configuration to SSLConfiguration property


--
--
Caché, Ensemble, DeepSee

---
You received this message because you are subscribed to the Google Groups "Caché, Ensemble, DeepSee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to intersystems-publi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Dmitry Maslennikov
Senior Caché Developer
Skype: DAiMor

Tom Fitzgibbon

unread,
Sep 25, 2016, 11:18:10 AM9/25/16
to intersystems...@googlegroups.com
Pandiyan -

I think google/gmail requires TLS/SSL. Also you have to set up SSLConfiguration for local Cache See http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GCAS_ssltls.

Tom Fitzgibbon | 347-464-8531

Try this:

SENDMAIL(from,to,subject,message)
 ;gmail notes
 ;set up SSLConfiguration in Cache 
 ;set up SMTP relay service setting in https://support.google.com/a/answer/2956491
 ;n auth,m,s,status,ln
 s s=##class(%Net.SMTP).%New()
 s auth=##class(%Net.Authenticator).%New() ; use default authenticationlist
 s auth.UserName="mygmailuser"
 s auth.Password="mygmailpass"
 s s.authenticator=auth
 s s.smtpserver="smtp-relay.gmail.com"
 s s.port="465"
 s s.SSLConfiguration="GTEST"
 ;get the local time offset
 s offset="-0400"
 s s.timezone=offset ; may remove this line to get Universal Time
 s m=##class(%Net.MailMessage).%New()
 s m.Charset="iso-8859-1"
 s m.From=from
 d m.To.Insert(to)
 s m.Subject=subject
 ;f i=1:1 q:'$d(^cmailm(i))  s ln=^(i) d m.TextData.Write(ln_$c(13,10))
 d m.TextData.Write(message)
 s status=s.Send(m)
 ;status of 1 is good, 0 is bad
 d m.%Close()
 q status

On Sun, Sep 25, 2016 at 10:42 AM, PANDIYAN <pandi...@gmail.com> wrote:
Hi All,

I am trying to send a mail by using smtp.gmail.com,
        I got this this error ERROR #6034: SMTP server connection failed during init command: <READ>zGetResponse+5^%Net.SMTP.1.

Can you please let me know what's the problem over here? or Any other code is there by using SMTP?  

set s=##class(%Net.SMTP).%New()
set auth=##class(%Net.Authenticator).%New() ; use default authentication list
set auth.UserName="pandiyann07@gmail.com"
set auth.Password="xxxxxxx"
set s.authenticator=auth
set s.smtpserver="smtp.gmail.com"
set s.port=465
set m=##class(%Net.MailMessage).%New()
set m.From="pandi...@gmail.com"
do m.To.Insert("pandiyann07@gmail.com")
set m.Subject="Test mail"
do m.TextData.Write("Testing Mail's")
set status=s.Send(m)
if $$$ISERR(status) do $system.OBJ.DisplayError(status)
quit

Regards,
Pandiyan

--
--
Caché, Ensemble, DeepSee

---
You received this message because you are subscribed to the Google Groups "Caché, Ensemble, DeepSee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to intersystems-public-cache+unsub...@googlegroups.com.

PANDIYAN

unread,
Sep 25, 2016, 11:38:17 AM9/25/16
to Caché, Ensemble, DeepSee
Hi Daimor,
 
I have created SSL configuration through Management Portal and Programmatically I mentioned the SSL configuration 

After that I got this error
ERROR #6033: Error response to SMTP MAIL FROM: 530 5.5.1  https://support.google.com/mail/?p=WantAuthError 27sm24558639pfr.29 - gsmtp.

Can you please let me know what's the problem? What I should to do?

set s=##class(%Net.SMTP).%New()
set auth=##class(%Net.Authenticator).%New() ; use default authentication list
set auth.UserName="pandi...@gmail.com"
set auth.Password="xxxxxxxx"

set s.authenticator=auth
set s.smtpserver="smtp.gmail.com"
set s.port=465
set s.SSLConfiguration="Lotus"

set m=##class(%Net.MailMessage).%New()
set m.From="pandi...@gmail.com"
do m.To.Insert("pandi...@gmail.com")
set m.Subject="Test mail"
do m.TextData.Write("Testing Mail's")
set status=s.Send(m)
if $$$ISERR(status) do $system.OBJ.DisplayError(status)
quit

To unsubscribe from this group and stop receiving emails from it, send an email to intersystems-public-cache+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Dmitry Maslennikov

unread,
Sep 25, 2016, 12:03:28 PM9/25/16
to Caché, Ensemble, DeepSee
It looks like your password is wrong, if you sure that its correct, you should follow the link which you got in error message. And look at ways how to solve it.

To unsubscribe from this group and stop receiving emails from it, send an email to intersystems-publi...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--
Dmitry Maslennikov
Senior Caché Developer
Skype: DAiMor

--
--
Caché, Ensemble, DeepSee

---
You received this message because you are subscribed to the Google Groups "Caché, Ensemble, DeepSee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to intersystems-publi...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

PANDIYAN

unread,
Sep 26, 2016, 9:24:16 AM9/26/16
to Caché, Ensemble, DeepSee

Fitzgibbon,

I got the this error (ERROR #6029: Timed out waiting for response.1), while run the below code
Can you please let me know why its taking time? or I need change anything in this code?

Becuse I tried to open the smtp server,It's working fine
open "|TCP|25":("127.0.0.1:25):5

Can you please let me know what's the problem over here?

 set s=##class(%Net.SMTP).%New()
 set s.smtpserver="127.0.0.1"
 set s.port=25
 set auth=##class(%Net.Authenticator).%New() ; use default authentication list
 set auth.UserName="aa...@xxx.com"
 set auth.Password="xxxxxxxx"
 set s.authenticator=auth
 set m=##class(%Net.MailMessage).%New()
 set m.From="aa...@xxx.com"
 do m.To.Insert("bb...@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
set auth.UserName="pandi...@gmail.com"
set auth.Password="xxxxxxx"
set s.authenticator=auth
set s.smtpserver="smtp.gmail.com"
set s.port=465
set m=##class(%Net.MailMessage).%New()
set m.From="pandi...@gmail.com"
do m.To.Insert("pandi...@gmail.com")
set m.Subject="Test mail"
do m.TextData.Write("Testing Mail's")
set status=s.Send(m)
if $$$ISERR(status) do $system.OBJ.DisplayError(status)
quit

Regards,
Pandiyan

Anil Mathew

unread,
Mar 19, 2017, 12:18:00 AM3/19/17
to Caché, Ensemble, DeepSee
Hi Pandiyan,
Were you able to get this working?
Regards
Anil
Reply all
Reply to author
Forward
0 new messages