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 regard 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 on his/her VPS.

  • 2 Users Found This Useful

Was this answer helpful?

Related Articles

ASPJpeg support on Windows 2008 / 2012 servers

Yes, we have installed ASPJpeg component on Windows 2008 and Windows 2012 shared hosting servers....

How to send email through CDONTS Email?

CDONTS stands for "Collaboration Data Objects for Windows NT Server" and as the name suggests it...

How to use Dundas Chart?

How to create a Basic Pie Chart with Dundas Chart To use this control in a web site, you will...

How to send emails using ASP.Net (VB)?

This topic includes the sample code to send email from ASP.Net(VB) code :Sample Code :<%@...

How to use ASP Simple Upload component?

Sample code: <% Option Explicit Dim upl, NewFileName Set upl =...