A S P M a i l

AspMail allows you to send mail using the standard SMTP protocol from any program that can use ActiveX/OLE components. ASPMail can also be used in ColdFusion templates.

Documentation for ASPMail is available on the ServerObjects website

We recommend that ASPMail is only used by competent ASP programmers. Official support is limited to confirming that our own demo/test files are functioning correctly are your server.

If you have problems using ASPMail post an account (with code) of the problem and any errors onto our support webboard (ASP Conference).

Our test page consists of a basic html page containing a form which links to an ASP page which submits the mail message to an SMTP server. The code is given below as an example.

sendmail.htm

<html> <head> <title>ASP Mail Test Form</title> <style type="text/css"> <!-- body, p { font-family: Verdana,arial,helvetica; font-size: 12px} h2 { font-family: Verdana,arial,helvetica; font-size: 15px; color: #cc0000; } h3 { font-family: Verdana,arial,helvetica; font-size: 14px; color: #000099; } td { font-family: Verdana,arial,helvetica; font-size: 12px } --> </style> <body bgcolor="#FFFFFF"> <h2>ASP Form Mailer - Test Form Page</h2> <form method="GET" action="sendmail.asp"> <!-- if you change the method to POST change the ASP file to get a form var instead of a query var! --> <table> <tr> <td>Enter Mail to Address:</td> <td><input type="text" name="addressto" size="20"></td> </tr> <tr> <td>Enter Mail to Name:</td> <td><input type="text" name="nameto" size="20"></td> </tr> <tr valign="top"> <td>Enter Mail Message:</td> <td><textarea name="txtmsg" rows="8" cols="40"></textarea></td> </tr> <tr> <td colspan="2" align="right"><input type="submit" value="Send Mail"></td> </tr> </table> </form> </body> </html>

sendmail.asp

<html>
<head>
<title>ASP Mail Test Form Results</title>
<style type="text/css">
<!--
body, p { font-family: Verdana,arial,helvetica; font-size: 12px}
h2 { font-family: Verdana,arial,helvetica; font-size: 15px; color: #cc0000; }
h3 { font-family: Verdana,arial,helvetica; font-size: 14px; color: #000099; }
td { font-family: Verdana,arial,helvetica; font-size: 12px }
-->
</style>
<body bgcolor="#FFFFFF">

<h2>ASP Form Mailer - Test Results</h2>

<p>Mail to: <% = Request.QueryString("addressto") %>... <%
     Set Mailer = Server.CreateObject("SMTPsvg.Mailer")

     rem change this RemoteHost to a valid SMTP address before testing
     Mailer.RemoteHost  = "mail.xhost.co.uk"

     Mailer.FromName    = "WEB Test"
     Mailer.FromAddress = "support@xhsot.co.uk"
     Mailer.AddRecipient Request.QueryString("nameto"), Request.QueryString("addressto")
     Mailer.Subject     = "ASP Mail test"
     Mailer.BodyText    = Request.QueryString("txtmsg")

     if not Mailer.SendMail then
       Response.Write " failed... Error is: <br>"
       Response.Write Mailer.Response
     else
       Response.Write " sent successfully...<p>"
     end if
     %> 
</p>
</body>
</html>

copyright 2003 Xhost Ltd All rights reserved