This is only short tutorial about how to send email using ASPEmail. If you require ASPEmail Hosting with low cost, please visit our site at http://www.hostforlife.eu. You can always start from €3.00/month to get this feature.

AspEmail is an active server component for sending email messages using an external SMTP server in an ASP or VB environment. AspEmail supports multiple recipients, multiple CC, multiple Bcc, multiple file attachments, HTML format, embedded images, and non-US ASCII character sets. 

A free copy of AspEmail can be downloaded from www.aspemail.com/download.html. 

Changing from AspMail to AspEmail 

Please make sure that you have valid email address to implement this code below:

<%
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "mail.yourdomain.com" 
Mail.From = "[email protected]
Mail.FromName = "Support Team" 

Mail.AddAddress "[email protected]", "ScottT”
Mail.AddAttachment "e:\html\domains\yourdomaincom\html\filename.htm"

Mail.Subject = "Support Issue"
Mail.Body = "Dear Scott:" & chr(13) & chr(10) & _
"Have a nice day and thank you."

On Error Resume Next
Mail.Send
If Err <> 0 Then
Response.Write "An error occurred: " & Err.Description
End If
%> 


NOTE: For the Mail.Host line, put the IP address of your web server, NOT the mail server IP. 

To add the message recipients, CCs, BCCs, and Reply-To's, use the AddAddress, AddCC, AddBcc and AddReplyTo methods, respectively. These methods accept two parameters: the email address and, optionally, name. Notice that you must not use an '= 'sign to pass values to the methods. For example: 

Mail.AddAddress "[email protected], "Support Team"
Mail.AddCC "[email protected]" ' Name is optional


Use the Subject and Body properties to specify the message subject and body text, respectively. A body can be in a text or HTML format. In the latter case, you must also set the IsHTML property to True.

For example: Mail.Subject = "Support Issue"
Mail.Body = "Dear Scott:" & chr(13) & chr(10) & "Have a nice day and thank you."


or

Mail.Subject = "Support Issue"
Mail.Body="<HTML><BODY BGCOLOR=#0000FF>DearScott:....</BODY></HTML>"
Mail.IsHTML = True


To send a file attachment with the message, use the AddAttachment method. It accepts the full path to the file being attached. Call this method as many times as you have attachments.

Notice that you must not use the '= 'sign to pass a value to the method: 

** Note from Tech Support: the path below is correct for you. Make sure that you put your attachment in this directory first. Don't forget that "yourdomaincom" may be "yourdomainnet", etc., as applicable. ** 

Mail.AddAttachment "e:\html\domains\yourdomaincom\html\filename.htm"

In order to reference information from fields on a form you will need to use the following format:

"First Name: " & Request.form("FirstName") & chr(13) & chr(10) & _
"Last Name: " & Request.form("LastName") & chr(13) & chr(10) & _
"Email: " & Request.form("Email") & chr(13) & chr(10) & _


To send a message, call the Send method. The method throws exceptions in case of an error. You may choose to handle them by using the On Error Resume Next statement, as follows: 

On Error Resume Next
Mail.Send
If Err <> 0 Then
Response.Write "An error occurred: " & Err.Description
End If

HostForLIFE.eu ASPEmail Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments.