Sending Email
Some programmers do the mistake not utilizing the inbuild mail settings built into web.config file. By utlizing the feature you are forced not to use hardcoded email settings.
Changing the email settings like smtp server, authentication, ports can be made lot easier if you use web.config to sotre your mail settings.
Web.config settings
C# code to send mail
MailMessage message = new MailMessage();
message.From = new MailAddress("senderatdot4pro.com");
message.To.Add(new MailAddress("recipient1atdot4pro.com"));
message.To.Add(new MailAddress("recipient2atdot4pro.com"));
message.To.Add(new MailAddress("first1atgmaildotcom"));
message.CC.Add(new MailAddress("sendtoatgmaildotcom"));
message.Subject = "This is my subject";
message.Body = "This is the body. can be html body";
SmtpClient client = new SmtpClient();
client.Send(message);
blog comments powered by Disqus