How can I send Email in ASP.Net using C#
Answer:
You can use the following code for sending Email:
MailMessage msg = new MailMessage();
msg.From = txtFrom.Text);
msg.To=txtTo,text;
msg.Subject =txtSubject
msg.IsBodyHtml = true;
msg.Body =txtBody.text;
msg.Priority = MailPriority.High;
System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("smtp.gmail.com", 25);
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential("xxxxx@gmail.com", "xxxx"); // Mail Id and it's Password
client.EnableSsl = true;
client.Send(msg);
Answer:
You can use the following code for sending Email:
MailMessage msg = new MailMessage();
msg.From = txtFrom.Text);
msg.To=txtTo,text;
msg.Subject =txtSubject
msg.IsBodyHtml = true;
msg.Body =txtBody.text;
msg.Priority = MailPriority.High;
System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("smtp.gmail.com", 25);
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential("xxxxx@gmail.com", "xxxx"); // Mail Id and it's Password
client.EnableSsl = true;
client.Send(msg);
If any suggestion OR any question regarding ASP.Net then drop a mail to mnalammwb@gmail.com
No comments:
Post a Comment