System.Net.Mail & additional fields

I understand how to send mail using MailMessage, but what if I want to add additional fields to the body of the email, say a telephone and fax number, or any number of fields?  I think it should go in the body, but I am not getting all to show correctly on the email.  Can someone explain how I might expand what can be sent in the email body?  Below is the code I am starting with.

Using .NET 2.0 and VB.
Thanks
Rick

Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
        'Email address to send contact for to
        Const ToAddress As String = "me@myself.com"
        
        'Create the MailMessage instance
        Dim mm As New MailMessage(tbEmail.Text, ToAddress)
 
 
        'Assign the MailMessage's properties
        mm.Subject = dlSubject.Text
        mm.Body = tbComments.Text
        mm.IsBodyHtml = False
 
        'Create the SmtpClient object
        Dim smtp As New SmtpClient
 
        'Send the MailMessage using the Web.config settings)
        smtp.Send(mm)
 
        'Show the EmailSentForm Panel and hide the EmailForm Panel
        EmailSentForm.Visible = True
        Me.contactform.Visible = False
        'ContactForm.Visible = False

Open in new window

LVL 2
simprickAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TechTiger007Commented:
Mail body will take a string (plain text or HTML) that will be displayed as the email message.

If you want to include more data in the email body you can construct a string that includes all the data to be displayed and in the specific format and finally assign the string to mail body.

Something like below

dim mailbody as string
mailbody = tbComments.Text & Environment.NewLine
mailbody &= "Telephone number : " & txtTelephoneNumber.Text & Environment.NewLine
mailbody &= "Address : " & txtAddress1.Text & Environment.NewLine

If you want to have more control over the mail body you can use HTML format
mailbody &= "<b>Telephone Number :  </b>" & txtTelephoneNumber.Text & "<br/>"
...
...

then you have to set mm.IsBodyHtml = true
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
simprickAuthor Commented:
Thanks much, I think html will be they way to go on the final product.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.