Link to home
Start Free TrialLog in
Avatar of Wildone63
Wildone63

asked on

Format email when using system.web.mail

I have an aspx form that a user submits information, which is recorded to a database.

I want to send an email confirming their info. I am using vb.net a system.web.mail. Sending a static email works fine, but I want to include session variables of what they submitted and format the email such as put the data into a table.

I am having trouble formatting the text to send the HTML email.

Here is what I am trying...
I start with        

Session("EmailMsg") = "<b>Thank You for your Order: </b> " & Session("MyOrder") & "<br/>"

Then for each row of inforation the user submits I am doing this...

Session("EmailMsg") = Session("emailmsg") & lblItem1.Text & "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & lblDescp1.Text & "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & txtQty1.Text & "<br/>"

I have tried things like with no success

Session("EmailMsg") = Session("emailmsg") & "<table><td> lblItem2.Text</td> & "" & <td>lblDescp2.Text</td> & "" & <td>txtQty2.Text</td> &</table><br/> "


Can someone help me with formatting this email.

Thank You.
ASKER CERTIFIED SOLUTION
Avatar of brutaldev
brutaldev
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Excuse the last line, that's my C# showing through :)
It should be:
Dim emailText As String = sb.ToString()

Open in new window

Avatar of Wildone63
Wildone63

ASKER

Perfect!

Thank You!