Tuesday, 15 May 2012

vb.net - Email form: personalised 'thank you' page -



vb.net - Email form: personalised 'thank you' page -

i have in vb.net contact form:

protected sub btnsubmit_click1(sender object, e eventargs) dim mail service new mailmessage()

mail.to.add(txtemail.text) mail.from = new mailaddress("info@mysite.net") mail.subject = "contact form" 'mail.bcc = new mailaddress mail.body = txtname.text & vbcrlf & txtcomments.text dim smtp new smtpclient("mail.server") smtp.credentials = new networkcredential("email id", "pwd") smtp.send(mail) response.redirect("thankyou.aspx" & mail.to) lblstatus.text = "your info has been submitted successfully" txtname.text = "" txtemail.text = "" txtcomments.text = "" end sub

the mail.to in response.redirect giving me error:

operator '&' not defined types 'string' , 'system.net.mail.mailaddresscollection'.

i imagine need create separate personalised aspx 'thank you' page, need way of getting user's name form field data.

thanks advice.

do mean this:

response.redirect("thankyou.aspx" & request.querystring["email.text"];

mail.to collection. seek email.text (which passed mail service address).

vb.net

No comments:

Post a Comment