Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format message sent from a form 1

Status
Not open for further replies.

Jaminj

Technical User
Feb 19, 2005
54
US
Hello. How do I format the message that is sent from a form? Here is the code I am using to send the message:

Dim mailMessage As New MailMessage()
mailMessage.From = "abc@domain.com"
mailMessage.To = "def@domain.com"
mailMessage.body = txtstorenum.Text
SmtpMail.Send(mailMessage)

The body will then show just the # from the txtstorenum text box. How can I format the body to show multiple fields from the form? I would also like to format it so the person who receives the message knows what they are looking at. Here is an example:

From: txtname.Text
Store #: txtstorenum.Text

I'm sure this is easy to do, I just don't have much programming experience. Thanks.
 
You can just append other variables/text to the body property. e.g.
Code:
mailMessage.body = "This is a message from Store Number :" & txtstorenum.Text & " and this is the text from another textbox: " & txtMyOtherTextbox.Text

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top