ASPMail

AspMail allows you to send mail using the standard SMTP protocol from any program that can use ActiveX/OLE components.

Note: ASPMail can also be used by Cold Fusion developers.

Documentation is available on the suppliers website

We recommend that ASPMail is only used by competent ASP programmers. Support of ASPMail is limited to testing its functionality from our own test page. We are unable to debug ASP code.

Our test page consists of a basic html page containing a form which links to an ASP page which submitts 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></head>
<body bgcolor="#FFFFFF">

<FONT FACE="Verdana, Arial" SIZE="-0" color="#000099"><b>ASP Form Mailer - Test Form Page</b><p></font>
<p>
<form method="GET" action="scripts/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><FONT face="Verdana,Arial,Helvetica" SIZE="-1">Enter Mail to Address:</font></td>
         <td><input type="text" name="addressto" size="20"></td></tr>
  <tr><td><FONT face="Verdana,Arial,Helvetica" SIZE="-1">Enter Mail to Name:</font></td>
         <td><input type="text" name="nameto" size="20"></td></tr>
  <tr valign="top"><td><FONT face="Verdana,Arial,Helvetica" SIZE="-1">Enter Mail Message:</font></td>
         <td><textarea name="txtmsg" rows="8" cols="40"></textarea></td></tr>
  <tr><td> </td><td><input type="submit" value="Send Mail"></td></tr>
</table>
</form>

</body>
</html>

sendmail.asp

<html>
<head><title>ASP Mail Test Form Results</title><head>
<body bgcolor="#FFFFFF">
<FONT FACE="Verdana, Arial" SIZE="-0" color="#000099"><b>ASP Form Mailer - Test Results</b><p></font>
<p>

<FONT face="Verdana,Arial,Helvetica" SIZE="-1">
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 = "techmail@xhost.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
%>

</body>
</html>