Loading
  1.     Set myMail = CreateObject("CDO.Message")
  2.  
  3.         myMail.From = """Precision Decisions"" <info@precisiondecisions.co.uk>"
  4.  
  5.         myMail.To = "someone@precisiondecisions.co.uk"
  6.  
  7.         myMail.Subject = "Test email sent on " & Now()
  8.  
  9.         myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
  10.         myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.sendgrid.net"
  11.         myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587
  12.         myMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
  13.         myMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "USERNAME"
  14.         myMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "PASSWORD"
  15.         myMail.Configuration.Fields.Update
  16.  
  17.         myMail.TextBody = "Hello." & VbCrLf & VbCrLf & "This plaintext test email was sent on " & Now()
  18.  
  19.         myMail.Send
  20.  
  21.     Set myMail = nothing

Comments