Google Mail SMTP Syntax Erro - WeOnlyDo Discussion board

Google Mail SMTP Syntax Erro (wodSmtp)

by Chris Demmings, Friday, May 09, 2008, 23:44 (5828 days ago)

Hi,

When using the '6. CC and BCC' project and setting the parameters shown for connecting to the google smtp, we receive the following errors in the debug log for that example program.

wodSmtp1.Authentication = AuthAuto
wodSmtp1.Security = SecurityAllowed

wodSmtp1.Hostname = smtp.googlemail.com
wodSmtp1.Port = 587

wodSmtp1.Login = myusername@gmail.com
wodSmtp1.Password = mypasswordforgoogle

The following is in the debug screen:
--------------------
State changed to Connected to the server.
Connected, server capabilities are:
SIZE 28311552
8BITMIME
STARTTLS
ENHANCEDSTATUSCODESSIZE 28311552
8BITMIME
AUTH LOGIN PLAIN
ENHANCEDSTATUSCODES
State changed to Sending MAIL FROM command.
State chaState changed to Disconnected, will retry.
nged to Connected to the server.
State changed to Not connected.
DISCONNECTED 5.5.2 Syntax error. k35sm8221692waf.15
There are 0 recipients left
DONE!
State changed to Established SSL encryption.
State changed to Sending greeting to the server.
Connected, server capabilities are:
State changed to Sending greeting to the server.
State changed to Connecting to the server.
Connecting to smtp.googlemail.com
SIZE 28311552
8BITMIME
STARTTLS
ENHANCEDSTATUSCODESSIZE 28311552
8BITMIME
AUTH LOGIN PLAIN
ENHANCEDSTATUSCODES
State changed to Sending MAIL FROM command.
State changed to Connected to the server.
State changed to Not connected.
DISCONNECTED 5.5.2 Syntax error. j34sm8277369waf.48
There are 0 recipients left
DONE!
State changed to Disconnected, will retry.

-------------------------

We also tried
wodSmtp1.Security = SecurityImplicit
and it still does not work.

We also tried the other host address at

smtp.gmail.com

mentioned in the other forum entry.

Help

Thanks.

Re: Google Mail SMTP Syntax Erro

by woddrazen, Friday, May 09, 2008, 23:55 (5828 days ago) @ Chris Demmings

Hi Chris,


You can send e-mail with wodSMTP from Gmail SMTP server on this way:
[code]wodSmtp1.Security = SecurityImplicit
wodSmtp1.Authentication = AuthLogin
wodSmtp1.Login = someone( at )gmail( point )com
wodSmtp1.Password = somepass
wodSmtp1.Hostname = smtp.gmail.com
wodSmtp1.Port = 465

wodSmtp1.SendSimple someone( at )gmail( point )com , john( at )gmail( point )com , test , testing [/code]

Hope this helps.


Regards,
Drazen

Re: Google Mail SMTP Syntax Erro

by Chris Demmings, Monday, May 12, 2008, 17:21 (5826 days ago) @ woddrazen

Hi Chris,


You can send e-mail with wodSMTP from Gmail SMTP server on this way:
[code]wodSmtp1.Security = SecurityImplicit
wodSmtp1.Authentication = AuthLogin
wodSmtp1.Login = someone( at )gmail( point )com
wodSmtp1.Password = somepass
wodSmtp1.Hostname = smtp.gmail.com
wodSmtp1.Port = 465

wodSmtp1.SendSimple someone( at )gmail( point )com , john( at )gmail( point )com , test , testing [/code]

Hope this helps.


Regards,
Drazen

Hi Drazen,

Thanks for the response. I copied those suggestions into the test program and inserted by gmail username and password. The response from the program is still more or less the same. Has google put some kind of restrictions on this ?

Response from test program.
--------------------------
State changed to Disconnected, will retry.
State changed to Connecting to the server.
Connecting to smtp.gmail.com
State changed to Negotiating SSL encryption.
State changed to Established SSL encryption.
State changed to Sending greeting to the server.
State changed to Sending authentication information.
State changed to Connected to the server.
Connected, server capabilities are:
SIZE 28311552
8BITMIME
AUTH LOGIN PLAIN
ENHANCEDSTATUSCODES
State changed to Sending MAIL FROM command.
State changed to Connected to the server.
State changed to Not connected.
DISCONNECTED 5.5.2 Syntax error. f20sm13563302waf.53
There are 0 recipients left
DONE!

DONE!
State changed to Disconnected, will retry.

Re: Google Mail SMTP Syntax Erro

by wodDamir, Monday, May 12, 2008, 18:15 (5826 days ago) @ Chris Demmings

Hi Chris,

Can you try something like this. First set the conection properties:

[code]wodsmtp1.Authentication = AuthLogin
wodsmtp1.Login = login
wodsmtp1.Password = password
wodsmtp1.HostName = smtp.gmail.com
wodsmtp1.Security = SecurityImplicit[/code]

Once this is done, we need to parse the BCC fields. The code for this is already in the sample, but here it goes:

[code]BCC = hidden@user.com;another@hidden.user.com
i = 1
j = 1
Do
i = InStr(i, BCC, ; )
If i > 0 Then
recepients.Add Mid$(BCC, j, i - j)
j = i + 1
i = i + 1
Else
recepients.Add Mid$(BCC, j)
End If
Loop While i > 0[/code]

Now we need to send out those messages:

[code] wodsmtp1.Blocking = True

Dim k As Integer
For k = 1 To recepients.Count

wodsmtp1.Message.From = your_email@gmail.com
wodsmtp1.Message.To = recepients(k)
wodsmtp1.Message.CC = cc_address
wodsmtp1.Message.Subject = Some subject
wodsmtp1.Message.Text = Message text
wodsmtp1.SendMessage

Next k[/code]

This should work. Can you please try something like that?

Regards,
Damba

Re: Google Mail SMTP Syntax Erro

by wodDamir, Monday, May 12, 2008, 18:24 (5826 days ago) @ wodDamir

Chris,

Also, in the original sample, if you comment out the following lines in Done Event, it should work:

[code]'wodSmtp1.MailFrom = wodSmtp1.Message.From
'wodSmtp1.MailTo = Recipients.Item(1)[/code]

Perhaps that's easier and faster to try?

Regards,
Damba

Re: Google Mail SMTP Syntax Erro

by Chris Demmings, Tuesday, May 13, 2008, 20:54 (5825 days ago) @ wodDamir

Thank you,

except for the line...

wodsmtp1.Message.CC = cc_address

It worked great.

Thanks.

Re: Google Mail SMTP Syntax Erro

by woddrazen, Tuesday, May 13, 2008, 21:17 (5825 days ago) @ Chris Demmings

Chris,


You should use same approach for CC.

Why don't you try 6. CC and BCC sample in wodSMTP Samples\VB\Component\6. CC and BCC folder.

You can find there complete solution.


Drazen