Click here to Skip to main content
12,255,431 members (31,572 online)
   

ASP.NET

 
AnswerRe: multilanguage application Pin
Sandeep Mewara26-Feb-13 5:38
mvpSandeep Mewara26-Feb-13 5:38 
GeneralRe: multilanguage application Pin
Member 870181327-Feb-13 4:38
memberMember 870181327-Feb-13 4:38 
GeneralRe: multilanguage application Pin
Sandeep Mewara27-Feb-13 4:48
mvpSandeep Mewara27-Feb-13 4:48 
GeneralRe: multilanguage application Pin
Member 870181327-Feb-13 6:24
memberMember 870181327-Feb-13 6:24 
GeneralRe: multilanguage application Pin
Sandeep Mewara27-Feb-13 6:28
mvpSandeep Mewara27-Feb-13 6:28 
GeneralRe: multilanguage application Pin
Member 870181327-Feb-13 16:10
memberMember 870181327-Feb-13 16:10 
Questions/m has to send mail on button click event Pin
Member 870181318-Feb-13 5:24
memberMember 870181318-Feb-13 5:24 
AnswerRe: s/m has to send mail on button click event Pin
Sandeep Mewara18-Feb-13 5:57
mvpSandeep Mewara18-Feb-13 5:57 
Try something like:
public static void CreateTestMessage(string emailIdFromDatabase)
{
	MailAddress to = new MailAddress("development@relone.com");
	MailAddress from = new MailAddress(emailIdFromDatabase);
	MailMessage message = new MailMessage(from, to);
	message.Subject = "Using the new SMTP client.";
	message.Body = @"Using this new feature, you can send an e-mail message from an application very easily.";
	// Use the application or machine configuration to get the 
	// host, port, and credentials.
	SmtpClient client = new SmtpClient();
	Console.WriteLine("Sending an e-mail message to {0} at {1} by using the SMTP host={2}.",
		to.User, to.Host, client.Host);
try {
	  client.Send(message);
	}
	catch (Exception ex) {
	  Console.WriteLine("Exception caught in CreateTestMessage(): {0}", 
            ex.ToString() );			  
  }
}
For a Web application, the parameterless constructor of SmtpClient reads its configuration from the web.config configuration file.
Refer: MSDN: SmtpClient Constructor[^]

For more details on sending email, have a look at this Microsoft Video tutorial:
Video: Use ASP.NET to send Email from Website[^]
Tutorials on sending Email in ASP.NET[^]
Sandeep Mewara
Microsoft ASP.NET MVP 2012 & 2013

[My Blog]: Sandeep Mewara's Tech Journal!
[My Latest Article]: HTML5 Quick Start Web Application

GeneralRe: s/m has to send mail on button click event Pin
Member 870181318-Feb-13 6:42
memberMember 870181318-Feb-13 6:42 
GeneralRe: s/m has to send mail on button click event Pin
Sandeep Mewara18-Feb-13 6:49
mvpSandeep Mewara18-Feb-13 6:49 
GeneralRe: s/m has to send mail on button click event Pin
Member 870181318-Feb-13 7:26
memberMember 870181318-Feb-13 7:26 
Questionsending mail on button click event from the s/m Pin
Member 870181318-Feb-13 5:15
memberMember 870181318-Feb-13 5:15 
AnswerRe: sending mail on button click event from the s/m Pin
Sandeep Mewara18-Feb-13 6:00
mvpSandeep Mewara18-Feb-13 6:00 
QuestionUsing Ajax in my project Pin
javeed03518-Feb-13 3:32
memberjaveed03518-Feb-13 3:32 
Questionweb service keep a process open Pin
dcof17-Feb-13 13:12
memberdcof17-Feb-13 13:12 
AnswerRe: web service keep a process open Pin
N a v a n e e t h17-Feb-13 17:15
memberN a v a n e e t h17-Feb-13 17:15 
Questionerror in passing array parameter to a storedprocedure Pin
Member 870181316-Feb-13 16:28
memberMember 870181316-Feb-13 16:28 
AnswerRe: error in passing array parameter to a storedprocedure Pin
Sandeep Mewara16-Feb-13 18:18
mvpSandeep Mewara16-Feb-13 18:18 
GeneralRe: error in passing array parameter to a storedprocedure Pin
Member 870181316-Feb-13 20:45
memberMember 870181316-Feb-13 20:45 
QuestionPublishing asp.net website on cpanel Pin
Arun kumar Gautam15-Feb-13 2:12
memberArun kumar Gautam15-Feb-13 2:12 
AnswerRe: Publishing asp.net website on cpanel Pin
Richard Deeming15-Feb-13 2:38
memberRichard Deeming15-Feb-13 2:38 
Questionasp.net Pin
Member 983745515-Feb-13 0:49
memberMember 983745515-Feb-13 0:49 
AnswerRe: asp.net Pin
Marco Bertschi15-Feb-13 2:43
memberMarco Bertschi15-Feb-13 2:43 
AnswerA quick tip for new members... Pin
Marco Bertschi15-Feb-13 2:49
memberMarco Bertschi15-Feb-13 2:49 
AnswerRe: asp.net Pin
Sandeep Mewara15-Feb-13 10:07
mvpSandeep Mewara15-Feb-13 10:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.160426.1 | Last Updated 5 May 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid