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

How to send Emails via ASP using SMTP authentication?

This topic includes the sample code to send email from ASP.Net using C# code :Sample Code :<%@...

How to use Dundas Mailer?

A. Sending an Email with the QuickSend Method <% Dim objMailer 'Mailer control Set...

How to send emails through JMail?

We have installed JMail on our Windows shared servers. You can use following sample script to...

How to use ASPUpload?

ASPUpload is a COM+ component, which enables an ASP application to capture, save and process the...

How to use Dundas Upload?

Dundas upload control is a flexible and reliable component allows you to accept, save, and...