Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
I am using this Macro for sending Mail through Gmail Account. But there is some issues in this.It get stopped at objmail.send.
Can anyone help me in this ?
Dim objEmail
Const cdoSendUsingPort = 2
Const cdoAnonymous = 0
Const cdoBasic = 1
Const cdoNTLM = 2
Const SMTPServer = "smtp.gmail.com"
Const SMTPPort = 465
Const SMTPTimeout = 60
Const user = "mygmailaccount"
Const psw = "mypassword"
Set objEmail = CreateObject("CDO.Message")
Set objConf = objEmail.Configuration
Set objFlds = objConf.Fields
With objFlds
'---------------------------------------------------------------------
' SMTP server details
.Item("schemas.microsoft.com/.../sendusing") = cdoSendUsingPort
.Item("schemas.microsoft.com/.../smtpserver") = SMTPServer
.Item("schemas.microsoft.com/.../smtpauthenticate") = codBasic
.Item("schemas.microsoft.com/.../sendpassword")= psw
.Item("schemas.microsoft.com/.../sendusername")= user
.Item("schemas.microsoft.com/.../smtpserverport") = SMTPPort
.Item("schemas.microsoft.com/.../smtpusessl") = True
.Item("schemas.microsoft.com/.../smtpconnectiontimeout") = SMTPTimeout
.Update
'---------------------------------------------------------------------
End With
objEmail.To = "toaccountemailid"
objEmail.From = "fromaccountemailid"
objEmail.Subject = "test"
objEmail.TextBody = "message de test"
objEmail.Send
Set objFlds = Nothing
Set objConf = Nothing
Set objEmail = Nothing
Gmail uses SSL, I believe you would need something like STUNNEL to make it work.
I have the same problem ![]()
anyone can help us ,I am too facing the same issue
Just a thought:
If you set up outlook for the gmail accoount, you should be able to use code for sending mail with outlook.
Hi Miguel
IT worked it out, I much thanks for your Assistance