Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim CDOmsg As CDO.Message
- Set CDOmsg = New CDO.Message
- With CDOmsg.Configuration.Fields
- .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
- .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
- .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
- .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "myemail@gmail.com"
- .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypass"
- .Item("http://schemas.microsoft.com/cdo/configuration/smptserverport") = 465
- .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'NTLM method
- .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
- .Update
- End With
- ' build email parts
- With CDOmsg
- .Subject = "the email subject"
- .From = "myemail@gmail.com"
- .To = "mailto@gmail.com"
- .CC = ""
- .BCC = ""
- .TextBody = "the full message body goes here. you may want to create a variable to hold the text"
- End With
- CDOmsg.Send
- Set CDOmsg = Nothing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement