Already registered? Log in
This guide provides a simple script to send an email using Classic ASP with your SMTP2GO account.
Please change the following variables in the script provided Step 2:
SMTP Username: A username from your account’s “Sending > SMTP Users” section.
SMTP Password: The password for your username from your account’s “Sending > SMTP Users” section.
From Email Address: Set an email address that is a verified sender in your account.
To Email Address: Set the recipient’s email address.
CC Email Address: Set the CC email address (if required).
Reply-To Email Address: Set the Reply-To email address (if required).
Email Subject Line: Set the email subject.
Email Body Content: Set the email body content.
The script:
‘— Send Via SMTP2GO
objConfig.Fields.Item(“http://schemas.microsoft.com/cdo/configuration/sendusing“) = 2
objConfig.Fields.Item(“http://schemas.microsoft.com/cdo/configuration/smtpserver“) = “mail.smtp2go.com”
objConfig.Fields.Item(“http://schemas.microsoft.com/cdo/configuration/smtpserverport“) = 2525
objConfig.Fields.Item(“http://schemas.microsoft.com/cdo/configuration/smtpauthenticate“) = 1
objConfig.Fields.Item(“http://schemas.microsoft.com/cdo/configuration/sendusername“) = “<SMTP Username>”
objConfig.Fields.Item(“http://schemas.microsoft.com/cdo/configuration/sendpassword“) = “<SMTP Password>”
‘— Create the email
objConfig.Fields.Update
set objMail = CreateObject(“CDO.Message”)
set objMail.Configuration = objConfig
objMail.From = “<From Email Address>”
objMail.To = “<To Email Address>”
objMail.Cc = “<CC Email Address>”
objMail.ReplyTo = “<Reply-To Email Address>”
objMail.Subject = “Email Subject Line”
objMail.HTMLBody = “Email Body Content”
‘— Email Sending Codeif (objMail.Send = 0) then
set objMail = nothing
response. Redirect (“default.asp?message=Successfully sent.”)
else
set objMail = nothing
response. Redirect (“default.asp?message=Error sending.”)
end if
%>
Try SMTP2GO free for as long as you like:
Try SMTP2GO Free → Paid plans available for over 1,000 emails/month.