sending a structural email using ASP

  • Thread starter Thread starter Rani
  • Start date Start date
R

Rani

hi guys I need to send an email from a form
the form is collecting data from a user and then submits it to us.
I would like the email to appear in the following format
Name:
Email:
Etc.

all I was able to do so far is:
strBody = "Name :" & strname & " Email :" & StrEmail
etc.

any idea ?
 
you could set the email to be HTML and use tables <br /> and that kinda
stuff....

otherwise, you can put a VbCrLf for a new line..

strbody = "Name :" & strname & VbCrLf & "Email :" ...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
 
Assuming you are talking about ASP.Net (your original post just said "ASP")
and you are using the classes in the System.Web.Mail namespace, simply set
the MailFormat property of your MailMessage

Dim mail As MailMessage = New MailMessage()
mail.From = sFrom
mail.To = sTo
mail.Subject = sSubject
mail.Body = sBody
mail.BodyFormat = MailFormat.Html


If you are using something else, it surely exposes a similar property that
let's you set the format...check the docs :)

Karl
 
followed is a function I created and the HTML syntax I am using
for some strange reason I can't get it to work, any idea ?

strBody = "<table><tr><td colspan=2><b>Cotact
Information</b></td></tr>"_
&" </tr><td>Name :</td><td>" & strName & "</td></tr>"_
&" </tr><td>Email :</td><td>" & strEmail & "</td></tr>"_
&" </tr><td>Home Phone :</td><td>" & strHomePh & "</td></tr>"_
&" </tr><td>Work Phone :</td><td>" & strWorkPh & "</td></tr>"_
&" </tr><td>Cell Phone :</td><td>" & strCellPh & "</td></tr>"_
&" </tr><td>Refered by :</td><td>" & strRfBy &
"</td></tr></table><Br>"_
&" <table><tr><td colspan=2 align=center><b>Moving From</b></td><td
colspan=2 align=center><b>Moving To</b></td></tr>"_
&" <tr><td>Address :</td><td>" & strFAdd & "</td><td>Address :
</td><td>" & strTAdd & "</td></tr>"_
&" <tr><td>City :</td><td>" & strFCity & "</td><td>City : </td><td>" &
strTCity & "</td></tr>"_
&" <tr><td>State :</td><td>" & strFState & "</td><td>State : </td><td>"
& strTAdd & "</td></tr>"_
&" <tr><td>Zip :</td><td>" & strFZip & "</td><td>Zip : </td><td>" &
strTZip & "</td></tr>"_
&" <tr><td>Size of residence: :</td><td>" & strFSize & "</td><td>Size
of residence : </td><td>" & strTSize & "</td></tr>"_
&" <tr><td># of Bedrooms :</td><td>" & strFBed & "</td><td># of
Bedrooms : </td><td>" & strTBed & "</td></tr>"_
&" <tr><td># of rooms :</td><td>" & strFRoom & "</td><td># of rooms :
</td><td>" & strTRoom & "</td></tr>"_
&" <tr><td colspan=2>Move date:</td><td colspan=2>" & strMoveDt &
"</td></tr></table><br>"_

&"<table><tr><td><table><tr><td><b>Family
Room</b></td><td><b>Quantity</b></td></tr>"_
&" <tr><td>Arm Chair</td><td>" & strArm &
"</td></tr><tr><td>Sofa</td><td>" & strSofa & "</td></tr>" _
&" <tr><td>Love Seat</td><td>" & strSeat &"</td></tr><tr><td>Coffee
Table</td><td>" & strCoffe & "</td></tr>"_
&" <tr><td>TV</td><td>" & strTv & "</td></tr><tr><td>Entertainment
Center</td><td>" & strEnt & "</td></tr>"_
&" <tr><td>&nbsp;</td></tr>"_
&"
<tr><td><b>Study</b></td><td><b>Quantity</b></td></tr><tr><td>Desk</td><td>"
& strDesk & "</td></tr>"_
&" <tr><td>File Cabinet</td><td>" & strFile & "</td></tr><tr><td>Book
Case</td><td>" & strBook & "</td></tr>"_
&" <tr><td>&nbsp;</td></tr>"_
&" <tr>
<td><b>Boxes</b></td><td><b>Quantity</b></td></tr><tr><td>Small</td><td>" &
strSmall & "</td></tr>"_
&" <tr><td>Medium</td><td>" & strMedium &
"</td></tr><tr><td>Large</td><td>" & strLarge & " </td></tr>"_
&" <tr><td>Wardrobe</td><td>" & strWardrobe &
"</td></tr><tr><td>Picture</td><td>" & strPicture &
"</td></tr></table></td>"_
&" <td>&nbsp;</td>"_
&" <td><table><tr><td><b>Dining
Room</b></td><td><b>Quantity</b></td></tr>"_
&" <tr><td>China Cabinet</td><td>" & strChina &
"</td></tr><tr><td>Chairs</td><td>" & strChairs & "</td></tr>"_
&" <tr><td>Table</td><td>" & strTable & "</td></tr>"_
&"
<tr><td>&nbsp;</td></tr><tr><td><b>Kitchen</b></td><td><b>Quantity</b></td></tr>"_
&" <tr><td>Appliances</td><td>" & strApp &
"</td></tr><tr><td>Table</td><td>" & strTab & "</td></tr>"_
&" <tr><td>Chairs</td><td>" & strChair & "</td></tr>"_
&"
<td>&nbsp;</td><tr><td><b>Bedroom</b></td><td><b>Quantity</b></td></tr>"_
&" <tr><td>Double Bed</td><td>" & strDouble & "</td></tr><tr><td>Queen
Bed</td><td>" & strQueen & "</td></tr>"_
&" <tr><td>King Bed</td><td>" & strKing & "</td></tr><tr><td>Single
Bed</td><td>" & strSingle & "</td></tr>"_
&" <tr><td>Dresser</td><td>" & strDresser &
"</td></tr></table></td></table></tr></table><br>"_
&" <table><tr><td><b>Comments :</b></td><td>" & strComments &
"</td></tr></table><br>"

call getquote
Response.Write "Thank You for Submitting the Request"
%>
<!--#include file="footer.asp"-->
<%
Function Getquote()
Dim objNewMail
Set objNewMail = CreateObject("CDONTS.NewMail")
objNewMail.From=StrEmail
objNewMail.To="(e-mail address removed)"
objNewMail.Subject="A New Quote Request"
objNewMail.Body=strbody
objNewMail.BodyFormat = objNewMailFormat.Html
objNewMail.Send
Set objNewMail = Nothing
END Function
 
Set objNewMail = CreateObject("CDONTS.NewMail")

This is the ASP.NET newsgroup - for questions about ASP.NET.

You need the ASP newsgroups for questions about ASP...

microsoft.public.inetserver.asp.general
microsoft.public.inetserver.asp.components
microsoft.public.inetserver.asp.db
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top