Celebrate Our 22nd Anniversary with Huge Savings! Up to 70% Off

How to use ASP Email?

ASPEmail 5.0 is an active server component for sending e-mail messages using an external SMTP server in an ASP or VB environment. ASPEmail 5.0 supports multiple recipients, multiple file attachments, HTML format, embedded images and sounds, non-US ASCII character sets, secure mail, and high-performance message queuing.

Sample code:

  1. <%
  2. strHost = "mail.serverhost.com"
  3. If Request("Send") <> "" Then
  4. Set Mail = Server.CreateObject("Persits.MailSender")
  5. Mail.Host = strHost
  6. Mail.From = Request("From")
  7. Mail.FromName = Request("FromName")
  8. Mail.AddAddress Request("To")
  9. Mail.Subject = Request("Subject")
  10. Mail.Body = Request("Body")
  11. strErr = ""
  12. bSuccess = False
  13. On Error Resume Next
  14. Mail.Send
  15. If Err <> 0 Then
  16. strErr = Err.Description
  17. else
  18. bSuccess = True
  19. End If
  20. End If
  21. %>


Explanation according to line:

  1. Open ASP tag
  2. Set the strHost variable with the email server host name
  3. Checking whether the data passed by an html form is empty or not
  4. Set Mailer control properties and collection items
  5. Set Mailer control properties and collection items
  6. Set Mailer control properties and collection items
  7. Set Mailer control properties and collection items
  8. Set Mailer control properties and collection items
  9. Set Mailer control properties and collection items
  10. Set Mailer control properties and collection items
  11. Set the strErr variable to empty
  12. Set the bSuccess variable to False
  13. If there is an error, go to the next line
  14. Send email
  15. If the error occurs then go to line (16)
  16. Display error description
  17. If no error occurs then go to line (18)
  18. Set the bSuccess variable to True upon success
  19. End if statement on line (15)
  20. End if statement on line (03)
  21. Close ASP tag

For further information, please refer to: http://www.aspemail.com/manual_01.html


Note: This may please be noted that this component can be uniformly used by all the users of Windows 2003 Shared Hosting. Whereas, as regards to our VPS users, the following guideline will be effective:

- This component is not offered with the purchase of a VPS, therefore, if any client wishes to use this, he/she will need to purchase and install it on his/her VPS.
 

Looking to send emails using ASP.NET (VB)? Click on Send Mail > Using ASP.NET (VB) for more details. To send emails via ASP using SMTP, Click on Send Mail > Using ASP SMTP.


Was this answer helpful?

« Back

chat