Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. Set objMail = CreateObject("CDO.Message")
  2. Set objConf = CreateObject("CDO.Configuration")
  3. Set objFlds = objConf.Fields
  4. objFlds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'cdoSendUsingPort
  5. objFlds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.your-site-url.com" 'your smtp server domain or IP address goes here
  6. objFlds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 'default port for email
  7. 'uncomment next three lines if you need to use SMTP Authorization
  8. 'objFlds.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "your-username"
  9. 'objFlds.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "your-password"
  10. 'objFlds.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'cdoBasic
  11. objFlds.Update
  12. objMail.Configuration = objConf
  13. objMail.FromName = "Your Name"
  14. objMail.From = "your@address.com"
  15. objMail.To = "destination@address.com"
  16. objMail.Subject = "Email Subject Text"
  17. objMail.TextBody = "The message of the email..."
  18. objMail.Send
  19. Set objFlds = Nothing
  20. Set objConf = Nothing
  21. Set objMail = Nothing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement