Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 11th, 2011, 09:40 AM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 119
Thanks: 26
Thanked 0 Times in 0 Posts
Default Contact form user control

Hi -

I used the contact control example in chapter 9, in a website I deployed. But when I send mail, it comes to my email box (which I redirected from my website) with the sender's name as "Sender Name Here" and recipient's email as "Receiver Name Here".

I've obviously missed something. Can anyone help?
 
Old December 11th, 2011, 10:04 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You missed replacing the text "Sender's name here" with your own. You can find the code in the control's code behind.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old December 14th, 2011, 03:37 PM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 119
Thanks: 26
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Imar View Post
You missed replacing the text "Sender's name here" with your own. You can find the code in the control's code behind.

Cheers,

Imar
Hi -
I just edited this to take out all the code I posted. I did not understand the way this was supposed to work. It now works to forward email to me under my name. What I was looking to do was see if it sent a confirmation email to the sender. Obviously you can't type that in there!

Thanks. Maybe somewhere else in the book it tells how to get the email to send a confirmation email to the sender?

Last edited by Rachel; December 14th, 2011 at 04:08 PM..
 
Old December 15th, 2011, 06:33 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Just get the user's e-mail address from a text box, and add it to the To collection just as you saw earlier.

In order for that to work you need to ensure the user enters a valid e-mail address. You can use the RegularExpressionValidator for that. In addition, it might be a good idea to implement exception handling (chapter 18) in case something goes wrong.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
email to send user data from contact form CheckBoxList tompatamcat ASP.NET 3.5 Basics 6 March 26th, 2013 12:11 AM
How to create contact form with file upload control ? Ranveer@2468 ASP.NET 4 General Discussion 0 August 17th, 2011 07:30 AM
Contact Form Control Problems with jQuery b_clodius BOOK: Beginning ASP.NET 4 : in C# and VB 9 May 23rd, 2010 12:36 PM
Chapter 9 pps 314-316 Contact Form User Control Featheriver BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 February 2nd, 2009 03:19 AM
Form View in User Control shoakat ASP.NET 2.0 Professional 0 June 20th, 2007 07:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.