Windows 2003 Web Hosting
 
Layerblue - Reliable Windows 2003 ASP.NET Coldfusion PHP Web Hosting

HTML & CSS validated by the W3C  

Valid HTML 4.01!Valid CSS!

Windows 2003 Web Hosting
Windows 2003 Web Hosting
 
Windows 2003 Web Hosting
 
  Click Here! Order Windows Web Hosting   ASPEMAIL COMPONENT USAGE  
 
   
 
 
 

SUPPORT - TUTORIALS - EMAIL

 

How to Use ASPEMAIL To Send An Email From Your Web Page
 

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.

Below you will find code samples taken from the ASPEmail documentation. For more information on the usage of this product, please visit them at http://www.aspemail.com

 

<%
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "Put IP address of your WEB server here"
Mail.From = "sales@yourdomain.com"
Mail.FromName = "Sales Department"

Mail.AddAddress "jsmith@company1.com", "John Smith"
Mail.AddAttachment "d:\domains\yourdomain.com\wwwroot\attachment.htm"

Mail.Subject = "Sales Receipt"
Mail.Body = "Dear John:" & chr(13) & chr(10) & _
"Thank you for your business."

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, you must put the IP address of your web server, not the mail server.

 

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 "jsmith@domain1.com", "John Smith"
Mail.AddCC "bjohnson@domain22.com" ' 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 = "Sales Receipt"
Mail.Body = "Dear John:" & chr(13) & chr(10) & "Thank you for your business."


Or

 

Mail.Subject = "Sales Receipt"
Mail.Body="<HTML><BODY BGCOLOR=#0000FF>DearJohn:....</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:
 

Mail.AddAttachment "d:\domains\yourdomain.com\wwwroot\attachment.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

 

   
     
Windows 2003 Web Hosting
 
Site Map - Terms Of Service - Acceptable Usage - Privacy Policy - Additional Services Windows 2003 Web Hosting, ASP, ASP.NET, Cold Fusion MX, CFMX, PHP, Perl, MySQL, MSSQL
 
Windows 2003 Web Hosting
 
Windows 2003 Server Hosting Windows 2003 Helm Web Hosting Windows 2003 Hosting Hardware Windows 2003 Hosting Dell Server Windows 2003 SSL Secure Hosting Layerblue - Windows 2003 Web Hosting