ASP development web-host provider

Contact  Place Order


resellers spacer

NT Web Hosting FAQ

Internet access for California spacer

Contact Wired Hosting in Bay Area spacer

Dedicated Servers spacer

Sign up! spacer

Virtual Web Hosting spacer

Web Hosting Help spacer



Have Questions?

Catch us on ICQ @ 40927225


   ASP Mail

 

 
How to use the ASP Mail component to send mail from a form
 

Create a file called formToEmail.htm with the following contents:

<FORM METHOD="POST" ACTION="formToEmail.asp">
<PRE>
Message Recipient: <INPUT SIZE=30 NAME="recipient" MAXLENGTH=200>
<P>
Message Sender: <INPUT SIZE=30 NAME="sender" MAXLENGTH=200>
<P>
Subject: <INPUT SIZE=30 NAME="subject" MAXLENGTH=512>
<P>
First Line Of Message: <TEXTAREA ROWS=2 COLS=60 NAME="messageline1"> </TEXTAREA>
<P>
Second Line Of Message: <TEXTAREA ROWS=2 COLS=60 NAME="messageline2"> </TEXTAREA>
</PRE>
<INPUT TYPE=submit VALUE=" Send ">

then create the ASP file formToEmail.asp to receive the form, and send the email:

<%
Set mailer = Server.CreateObject("ASPMAIL.ASPMailCtrl.1")
recipient = Request.Form("recipient")
sender = Request.Form("sender")
subject = Request.Form("subject")
message = Request.Form("messageline1")
message = message & vbCRLF
message = message & vbCRLF
message = message & Request.Form("messageline2")
mailserver = "mail.wiredhosting.com"
result = mailer.SendMail(mailserver, recipient, sender, subject, message)
%>
<% If "" = result Then %>
Mail has been sent.
<% Else %>
Mail was not sent, error message is
<H2>
<%= result %>
</H2>
<% End If %>

spacer 

Web Hosting Home |ASP.NET 2.0 Web Hosting | Internet Access | Hosting FAQ | Frontpage Hosting | OrderASP.NET Hosting Resellers | Contact
All content copyrighted by Wired Hosting© All rights reserved. Acceptable Use Policy


Microsoft, FrontPage, ASP, Windows NT, ASP.NET 2.0, Windows, Visual Web Developer, SQL Server 2005 Express, Visual Interdev are registered trademarks of Microsoft Corporation