correct syntax for system.net.mail

  • Thread starter Thread starter Mike P
  • Start date Start date
M

Mike P

I am building a message body to be sent by email, but I can't seem to
get the correct syntax for 2 lines where I am defining the <form> and
trying to pass parameters and where I am creating a hyperlink and again
trying to pass parameters to it. I have tried escaping the "s both like
this : \" and by replacing them with single quotes : ', but neither
method seems to pass the parameters. Can anybody advise?

Form line :

message.Body += "<FORM name='frmReferredEmail'
action='thank_you_referred.aspx?email=' + strEmailAddress + '&remail=' +
strEmailAddressRecommended + '&rpolicy=' + strPolicyNumber + '''
method='get'>";

Hyperlink line :

message.Body += "<tr><td><font color='black' face='Arial, Helvetica,
sans-serif' style='font-size: 11px'>If you have any problems submitting
this form please click <a class=mBlue
href='http://lbm-engine.com/insure/referred_web.aspx?remail=' +
strEmailAddressRecommended + '&email=' + strEmailAddress + '&rpolicy=' +
strPolicyNumber + '''>here</a>";
 
Mike said:
I am building a message body to be sent by email, but I can't seem to
get the correct syntax for 2 lines where I am defining the <form> and
trying to pass parameters and where I am creating a hyperlink and again
trying to pass parameters to it. I have tried escaping the "s both like
this : \" and by replacing them with single quotes : ', but neither
method seems to pass the parameters. Can anybody advise?

Form line :

message.Body += "<FORM name='frmReferredEmail'
action='thank_you_referred.aspx?email=' + strEmailAddress + '&remail=' +
strEmailAddressRecommended + '&rpolicy=' + strPolicyNumber + '''
method='get'>";

Hyperlink line :

message.Body += "<tr><td><font color='black' face='Arial, Helvetica,
sans-serif' style='font-size: 11px'>If you have any problems submitting
this form please click <a class=mBlue
href='http://lbm-engine.com/insure/referred_web.aspx?remail=' +
strEmailAddressRecommended + '&email=' + strEmailAddress + '&rpolicy=' +
strPolicyNumber + '''>here</a>";

If you want to post to more than one group, do a proper cross posting
instead of posting separate copies.

I already answered this question elsewhere. I believe it was in
m.p.d.framework.aspnet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top