Skip to content

Instantly share code, notes, and snippets.

@neopunisher
Created September 27, 2011 18:57
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neopunisher/1245911 to your computer and use it in GitHub Desktop.
Save neopunisher/1245911 to your computer and use it in GitHub Desktop.
Classic ASP send email
sub sendemail(subject,body,sto)
Set objMessage = CreateObject("CDO.Message")
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtp.gmail.com"
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "no-reply@brandextract.com"
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "passwd" ' change thus
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1
objMessage.Configuration.Fields.Update
objMessage.Subject = subject
objMessage.Sender = "no-reply@brandextract.com"
objMessage.bcc = "carter+tests@brandextract.com"
objMessage.HtmlBody = body
objMessage.To = sto
objMessage.Send
Set objMessage = nothing
end sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment