Wrox Programmer Forums
|
ASP.NET 4.5 General Discussion For ASP.NET 4.5 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4.5 General Discussion 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 November 6th, 2014, 10:25 AM
Registered User
Points: 22, Level: 1
Points: 22, Level: 1 Points: 22, Level: 1 Points: 22, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2014
Posts: 5
Thanks: 4
Thanked 1 Time in 1 Post
Question Send Email

How can we send mail to an email address, entered by the user during run time ?????
please help... waiting for your solution.

Code:
myMessage.To.Add(new MailAddress("[email protected]", "Receiver Name"));
this code is used to send mail to a specific email, but what can we do to send mail to an email address entered by the user during run time in a form.?????????
 
Old November 6th, 2014, 01:34 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Just replace the hard coded e-mail address string with some other data. If you have a TextBox control for the e-mail address, called EmailAddressTextBox for example, you could do something like this:

Code:
myMessage.To.Add(new MailAddress(EmailAddressTextBox.Text, "Receiver Name"));
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!
The Following User Says Thank You to Imar For This Useful Post:
dipjyoty (November 7th, 2014)
 
Old November 7th, 2014, 02:24 AM
Registered User
Points: 22, Level: 1
Points: 22, Level: 1 Points: 22, Level: 1 Points: 22, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2014
Posts: 5
Thanks: 4
Thanked 1 Time in 1 Post
Smile

Thank U





Similar Threads
Thread Thread Starter Forum Replies Last Post
send email msomar ASP.NET 4 General Discussion 11 July 26th, 2011 01:40 PM
Need to send email garrettbrennan Visual C++ 0 September 13th, 2007 12:24 PM
Send by email tsimsha Classic ASP Databases 1 October 1st, 2005 03:03 AM
To send an email Danny_n BOOK: Excel 2003 VBA Programmer's Reference 0 January 12th, 2005 08:33 AM
send email X-Ken VS.NET 2002/2003 8 July 2nd, 2004 06:13 AM





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