Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. Dim CDOmsg As CDO.Message
  2. Set CDOmsg = New CDO.Message
  3.  
  4. With CDOmsg.Configuration.Fields
  5. .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
  6. .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
  7. .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
  8. .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "myemail@gmail.com"
  9. .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypass"
  10. .Item("http://schemas.microsoft.com/cdo/configuration/smptserverport") = 465
  11. .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'NTLM method
  12. .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
  13. .Update
  14. End With
  15. ' build email parts
  16. With CDOmsg
  17. .Subject = "the email subject"
  18. .From = "myemail@gmail.com"
  19. .To = "mailto@gmail.com"
  20. .CC = ""
  21. .BCC = ""
  22. .TextBody = "the full message body goes here. you may want to create a variable to hold the text"
  23. End With
  24. CDOmsg.Send
  25. Set CDOmsg = Nothing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement