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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System.Net.Mail mail message

Status
Not open for further replies.

arkadia93

Programmer
Oct 19, 2006
110
GB
I am building up a message body, is this the correct way to escape chars in doing so?

message.Body += "<FORM name='frmReferredEmail' action=\"thank_you_referred.aspx?email=\" + strEmailAddress + \"&remail=\" + strEmailAddressRecommended + \"&rpolicy=\" + strPolicyNumber + '\" method='get'>";
 
Almost. I think what you are looking for is something like this:

Code:
message.Body += [COLOR=#CC0000]"<FORM name='frmReferredEmail' action=\"thank_you_referred.aspx?email="[/color] + strEmailAddress + [COLOR=#CC0000]"&remail="[/color] + strEmailAddressRecommended + [COLOR=#CC0000]"&rpolicy="[/color] + strPolicyNumber + [COLOR=#CC0000]"\" method='get'>"[/color];

Just had a few too many escapes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top