Re: Google Mail SMTP Syntax Erro - WeOnlyDo Discussion board

Re: Google Mail SMTP Syntax Erro (General questions)

by wodDamir, Monday, May 12, 2008, 18:15 (5917 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


Complete thread: