Advertisement
Guest User

Michael

a guest
Dec 22nd, 2009
381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Set iMsg = CreateObject("CDO.Message")
  2. Set iConf = CreateObject("CDO.Configuration")
  3. Set Flds = iConf.Fields
  4. schema = "http://schemas.microsoft.com/cdo/configuration/"
  5. Flds.Item(schema & "sendusing") = 2
  6. Flds.Item(schema & "smtpserver") = "smtp.gmail.com"
  7. Flds.Item(schema & "smtpserverport") = 465
  8. Flds.Item(schema & "smtpauthenticate") = 1
  9. Flds.Item(schema & "sendusername") = "YOUR@EMAIL.COM"
  10. Flds.Item(schema & "sendpassword") = "YOUR PASSWORD"
  11. Flds.Item(schema & "smtpusessl") = 1
  12. Flds.Update
  13.  
  14. If wscript.arguments.item(1) <> "" Then
  15.     body = wscript.arguments.item(1) & Chr(13) & Chr(10)
  16. End If
  17. If wscript.arguments.item(2) <> "" Then
  18.     dest =  wscript.arguments.item(2) & Chr(13) & Chr(10)
  19. End If
  20.                
  21.  
  22. With iMsg
  23. .To = dest
  24. .From = "MYOUR NAME <YOUR@EMAIL.COM>"
  25. .Subject = wscript.arguments.item(0)
  26. .TextBody = body
  27. .Sender = " "
  28. .Organization = " "
  29. .ReplyTo = " "
  30. Set .Configuration = iConf
  31. SendEmailGmail = .Send
  32. End With
  33.  
  34. set iMsg = nothing
  35. set iConf = nothing
  36. set Flds = nothing
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement