FreeTextHost.in host your text & codes anonymously


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

  1. <%
  2.  
  3. ' This script will send email through your Gmail / Google Apps email account
  4. ' on a Windows server.
  5. ' Put the values in the 'EDIT parts and see it work.
  6. ' Modify it to use for your website query form / feedback form.
  7.  
  8.  
  9. ' EDIT
  10. ' Type your Gmail or Google Apps complete email address
  11. Const cdogmailuser = ""
  12.  
  13.  
  14. ' EDIT
  15. ' Type your Gmail or Google Apps email password
  16. Const cdogmailpass = ""
  17.  
  18.  
  19. ' DO NOT EDIT
  20. Const cdoSendUsingPort = 2
  21. Const cdoAnonymous = 0
  22. ' Use basic (clear-text) authentication.
  23. Const cdoBasic = 1
  24. ' Create the message object.
  25. Set objMessage = CreateObject("CDO.Message")
  26.  
  27.  
  28. ' EDIT
  29. 'Set the FROM address .. this would be your own email address.
  30. objMessage.From = """Your_Name""<Your_Email_Address>"
  31.  
  32.  
  33. ' EDIT
  34. ' Set the TO Address .. separate multiple addresses with a comma
  35. objMessage.To = "Email_Of_Receiving_Person"
  36.  
  37. ' EDIT
  38. ' Set the Cc Address .. separate multiple addresses with a comma
  39. ' Remove the ' from the below line to send Cc email
  40. ' objMessage.Cc = "Email_Of_Receiving_Person_Cc"
  41.  
  42. ' EDIT
  43. ' Set the Bcc Address .. separate multiple addresses with a comma
  44. ' Remove the ' from the below line to send Bcc email
  45. ' objMessage.Bcc = "Email_Of_Receiving_Person_Bcc"
  46.  
  47. ' EDIT
  48. objMessage.ReplyTo = "Your_Email_Address"
  49.  
  50.  
  51. ' EDIT
  52. ' Set the Subject.
  53. objMessage.Subject = "from CDO ASP Google Apps"
  54.  
  55.  
  56. ' EDIT
  57. ' Use standared text for the body.
  58. 'objMessage.TextBody = "This is some sample message text.."
  59.  
  60. ' or ..
  61.  
  62.  
  63. ' EDIT
  64. Message = Message & "<font style='font-family: verdana; font-size: 12px;'>This email is through: Google Apps Email<br><br>"
  65. Message = Message & "Namaste<br><br>"
  66. Message = Message & "Server-USA.net</font>"
  67.  
  68. ' EDIT .. leave the above as it is to send HTML message
  69. ' You can use HTML as:
  70. objMessage.HTMLBody = Message
  71.  
  72.  
  73. ' or ..
  74.  
  75. ' EDIT
  76. ' get input from email form (fields) below
  77. ' Message = Message & "Name : " & Request.form("name") & "<br>"
  78. ' Message = Message & "Company Name : " & Request.form("company") & "<br>"
  79. ' Message = Message & "Email : " & Request.form("email") & "<br>"
  80. ' Message = Message & "Phone : " & Request.form("tel") & "<br>"
  81. ' Message = Message & "Email : " & Request.form("message") & "<br>"
  82.  
  83.  
  84. ' DO NOT EDIT BELOW THIS LINE .. go to last line to EDIT
  85.  
  86.  
  87. ' DO NOT EDIT
  88. ' This section provides the configuration information for the SMTP server.
  89. ' Specify the method used to send messages.
  90. objMessage.Configuration.Fields.Item _
  91. ("http://schemas.microsoft.com/cdo/configuration/sendusing") = _
  92. cdoSendUsingPort
  93.  
  94.  
  95. ' DO NOT EDIT
  96. ' The name (DNS) or IP address of the machine
  97. ' hosting the SMTP service through which
  98. ' messages are to be sent.
  99. objMessage.Configuration.Fields.Item _
  100. ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
  101. "smtp.gmail.com"
  102.  
  103.  
  104. ' DO NOT EDIT
  105. ' Specify the authentication mechanism
  106. ' to use.
  107. objMessage.Configuration.Fields.Item _
  108. ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = _
  109. cdoBasic
  110.  
  111.  
  112. ' DO NOT EDIT
  113. ' The username for authenticating to an SMTP server using basic (clear-text) authentication
  114. objMessage.Configuration.Fields.Item _
  115. ("http://schemas.microsoft.com/cdo/configuration/sendusername") = _
  116. cdogmailuser
  117.  
  118.  
  119. ' DO NOT EDIT
  120. ' The password used to authenticate
  121. ' to an SMTP server using authentication
  122. ' Password is Case SensitiVE
  123. objMessage.Configuration.Fields.Item _
  124. ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = _
  125. cdogmailpass
  126.  
  127.  
  128. ' DO NOT EDIT
  129. objMessage.Configuration.Fields.Item _
  130. ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = _
  131. 1
  132.  
  133.  
  134. ' DO NOT EDIT
  135. ' The port on which the SMTP service
  136. ' specified by the smtpserver field is
  137. ' listening for connections (typically 25)
  138. objMessage.Configuration.Fields.Item _
  139. ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = _
  140. 465
  141.  
  142.  
  143. ' DO NOT EDIT
  144. ' Set the number of seconds to wait for a valid socket to be established with the SMTP service before timing out.
  145. objMessage.Configuration.Fields.Item _
  146. ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = _
  147. 60
  148.  
  149.  
  150. ' DO NOT EDIT
  151. ' Update configuration
  152. objMessage.Configuration.Fields.Update
  153.  
  154.  
  155. ' DO NOT EDIT
  156. ' Send the message.
  157. objMessage.Send
  158.  
  159.  
  160. ' DO NOT EDIT
  161. ' Release the object
  162. Set objMessage = Nothing
  163.  
  164.  
  165. ' EDIT
  166. Response.Write "<br />Email has been sent."
  167. Response.Write "<meta http-equiv='refresh' content='0; URL=http://server-usa.net/'>"
  168.  
  169.  
  170. %>
Language:
To highlight particular lines, prefix each line with @@








freetexthost.in © 2010-2012 - Powered by PASTE 1.0   website by GandhiG.com