473,385 Members | 1,342 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

sending a structural email using ASP

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 ?

Nov 19 '05 #1
6 1380
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!)
"Rani" <ra***@hotmail.com> wrote in message
news:eu**************@TK2MSFTNGP15.phx.gbl...
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 ?

Nov 19 '05 #2
and how do i set the email to be html ?

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl...
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!)
"Rani" <ra***@hotmail.com> wrote in message
news:eu**************@TK2MSFTNGP15.phx.gbl...
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 ?


Nov 19 '05 #3
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

--
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!)
"Rani" <ra***@hotmail.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
and how do i set the email to be html ?

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl...
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!)
"Rani" <ra***@hotmail.com> wrote in message
news:eu**************@TK2MSFTNGP15.phx.gbl...
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 ?



Nov 19 '05 #4
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="ra***@hotmail.com"
objNewMail.Subject="A New Quote Request"
objNewMail.Body=strbody
objNewMail.BodyFormat = objNewMailFormat.Html
objNewMail.Send
Set objNewMail = Nothing
END Function

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:OO**************@TK2MSFTNGP10.phx.gbl...
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

--
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!)
"Rani" <ra***@hotmail.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
and how do i set the email to be html ?

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl...
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!)
"Rani" <ra***@hotmail.com> wrote in message
news:eu**************@TK2MSFTNGP15.phx.gbl...
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 ?




Nov 19 '05 #5
Rani:
So you are using ASP instead of ASP.Net...check out
http://www.4guysfromrolla.com/webtec...ail/faq6.shtml

According to that, you need to set 2 things in order to have HTML emails:

'you need to add these lines for the mail to be sent in HTML format
objMail.BodyFormat = 0
objMail.MailFormat = 0

hope this helps,
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!)
"Rani" <ra***@hotmail.com> wrote in message
news:uZ**************@TK2MSFTNGP12.phx.gbl...
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="ra***@hotmail.com"
objNewMail.Subject="A New Quote Request"
objNewMail.Body=strbody
objNewMail.BodyFormat = objNewMailFormat.Html
objNewMail.Send
Set objNewMail = Nothing
END Function

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:OO**************@TK2MSFTNGP10.phx.gbl...
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

--
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!)
"Rani" <ra***@hotmail.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
and how do i set the email to be html ?

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl...
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!)
"Rani" <ra***@hotmail.com> wrote in message
news:eu**************@TK2MSFTNGP15.phx.gbl...
> 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 ?
>
>
>



Nov 19 '05 #6
"Rani" <ra***@hotmail.com> wrote in message
news:uZ**************@TK2MSFTNGP12.phx.gbl...
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
Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: LC | last post by:
hi, i worry about people doing something they shouldn't to my db and I would like to track any structural changes (who and which)to my db. I am using oracle 8.0.6.0.0 and 9.2.0.2.0. regards,...
10
by: davidrubin | last post by:
Structural inheritance (inheriting implementation) is equivalent to composition in that a particular method must either call 'Base::foo' or invoke 'base.foo'. Apparantly, The Literature tells us to...
2
by: adam.spamfree | last post by:
Hi, I was just wondering if anyone could give me an explanation of what the difference between "structural" and "presentational" elements is. thanks a lot.
13
by: joe215 | last post by:
I want my users to send emails from a Windows app that I am developing in Visual Basic.NET 2003. I found a good example of sending email to a SMTP server using the SmtpMail class. However, using...
9
by: B-Dog | last post by:
I've built a small app that sends mail through our ISP's SMTP server but when I try to send through my local exchange server I get CDO error. Does webmail use SMTP or does it strictly rely on...
7
by: Mike McGavin | last post by:
Hi everyone. I'm searching for a quick and dirty way to have psql record the SQL statements that I enter, especially those related to the database structure. My main motivation is to help...
3
by: Ant | last post by:
Hi, I'm using the MailMessage & smtpMail classes in System.Web.Mail to send mail, however it's not sending any emails. I'm using it on a Windows 2003 server. The simplest way to use this is...
1
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to...
10
by: Markgoldin | last post by:
I am sending an XML data from not dontnet process to a .Net via socket listener. Here is a data sample: <VFPData> <serverdata> <coderun>updateFloor</coderun> <area>MD2</area>...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.