FREE TEXT HOST
You can save codes, scripts, sources & general debugging text and share / access / use them at any time (anonymously).You can even set yourself a password if you want to keep it just for yourself.
Posted by "ASP Emailer" on Thu, July 29th, 2010, 3:01 PM - Never Expires
Download | New paste
- <%
- ' This script will send email through your Gmail / Google Apps email account
- ' on a Windows server.
- ' Put the values in the 'EDIT parts and see it work.
- ' Modify it to use for your website query form / feedback form.
- ' EDIT
- ' Type your Gmail or Google Apps complete email address
- Const cdogmailuser = ""
- ' EDIT
- ' Type your Gmail or Google Apps email password
- Const cdogmailpass = ""
- ' DO NOT EDIT
- Const cdoSendUsingPort = 2
- Const cdoAnonymous = 0
- ' Use basic (clear-text) authentication.
- Const cdoBasic = 1
- ' Create the message object.
- Set objMessage = CreateObject("CDO.Message")
- ' EDIT
- 'Set the FROM address .. this would be your own email address.
- objMessage.From = """Your_Name""<Your_Email_Address>"
- ' EDIT
- ' Set the TO Address .. separate multiple addresses with a comma
- objMessage.To = "Email_Of_Receiving_Person"
- ' EDIT
- ' Set the Cc Address .. separate multiple addresses with a comma
- ' Remove the ' from the below line to send Cc email
- ' objMessage.Cc = "Email_Of_Receiving_Person_Cc"
- ' EDIT
- ' Set the Bcc Address .. separate multiple addresses with a comma
- ' Remove the ' from the below line to send Bcc email
- ' objMessage.Bcc = "Email_Of_Receiving_Person_Bcc"
- ' EDIT
- objMessage.ReplyTo = "Your_Email_Address"
- ' EDIT
- ' Set the Subject.
- objMessage.Subject = "from CDO ASP Google Apps"
- ' EDIT
- ' Use standared text for the body.
- 'objMessage.TextBody = "This is some sample message text.."
- ' or ..
- ' EDIT
- Message = Message & "<font style='font-family: verdana; font-size: 12px;'>This email is through: Google Apps Email<br><br>"
- Message = Message & "Namaste<br><br>"
- Message = Message & "Server-USA.net</font>"
- ' EDIT .. leave the above as it is to send HTML message
- ' You can use HTML as:
- objMessage.HTMLBody = Message
- ' or ..
- ' EDIT
- ' get input from email form (fields) below
- ' Message = Message & "Name : " & Request.form("name") & "<br>"
- ' Message = Message & "Company Name : " & Request.form("company") & "<br>"
- ' Message = Message & "Email : " & Request.form("email") & "<br>"
- ' Message = Message & "Phone : " & Request.form("tel") & "<br>"
- ' Message = Message & "Email : " & Request.form("message") & "<br>"
- ' DO NOT EDIT BELOW THIS LINE .. go to last line to EDIT
- ' DO NOT EDIT
- ' This section provides the configuration information for the SMTP server.
- ' Specify the method used to send messages.
- objMessage.Configuration.Fields.Item _
- ("http://schemas.microsoft.com/cdo/configuration/sendusing") = _
- cdoSendUsingPort
- ' DO NOT EDIT
- ' The name (DNS) or IP address of the machine
- ' hosting the SMTP service through which
- ' messages are to be sent.
- objMessage.Configuration.Fields.Item _
- ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
- "smtp.gmail.com"
- ' DO NOT EDIT
- ' Specify the authentication mechanism
- ' to use.
- objMessage.Configuration.Fields.Item _
- ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = _
- cdoBasic
- ' DO NOT EDIT
- ' The username for authenticating to an SMTP server using basic (clear-text) authentication
- objMessage.Configuration.Fields.Item _
- ("http://schemas.microsoft.com/cdo/configuration/sendusername") = _
- cdogmailuser
- ' DO NOT EDIT
- ' The password used to authenticate
- ' to an SMTP server using authentication
- ' Password is Case SensitiVE
- objMessage.Configuration.Fields.Item _
- ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = _
- cdogmailpass
- ' DO NOT EDIT
- objMessage.Configuration.Fields.Item _
- ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = _
- 1
- ' DO NOT EDIT
- ' The port on which the SMTP service
- ' specified by the smtpserver field is
- ' listening for connections (typically 25)
- objMessage.Configuration.Fields.Item _
- ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = _
- 465
- ' DO NOT EDIT
- ' Set the number of seconds to wait for a valid socket to be established with the SMTP service before timing out.
- objMessage.Configuration.Fields.Item _
- ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = _
- 60
- ' DO NOT EDIT
- ' Update configuration
- objMessage.Configuration.Fields.Update
- ' DO NOT EDIT
- ' Send the message.
- objMessage.Send
- ' DO NOT EDIT
- ' Release the object
- Set objMessage = Nothing
- ' EDIT
- Response.Write "<br />Email has been sent."
- Response.Write "<meta http-equiv='refresh' content='0; URL=http://server-usa.net/'>"
- %>