Click here to Skip to main content
14,383,884 members
Rate this:
Please Sign up or sign in to vote.
Hi all,
I am newbie to ASP.NET and now start learning MVC , to enhance my skills on .NET platform . Currently , i am practicing myself to do different task & pretty much know about MVC and eager to know how we can send email to client mailbox by using MVC5 . Can anyone share any link or blog ; from where i can learn and implement it . I read two or three articles but I don't understand the code properly how to use web helper class to implement it.

What I have tried:

Kindly share me the link , so that i can implement it ; i am highly appreciate for the same.
Posted
Updated 26-Feb-17 20:22pm

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

refer
[^]

string to = "jane@contoso.com";
	string from = "ben@contoso.com";
	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.";
	SmtpClient client = new SmtpClient(server);
	// Credentials are necessary if the server requires the client 
	// to authenticate before it will send e-mail on the client's behalf.
	client.UseDefaultCredentials = true;

    try {
	  client.Send(message);
	}  
	catch (Exception ex) {
	  Console.WriteLine("Exception caught in CreateTestMessage2(): {0}", 
                  ex.ToString() );			  
    }              
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100