TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sharad Mishra
NA
321
6.8k
No error and not getting email to recepient inbox
Aug 9 2016 12:47 AM
System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
mail.To.Add("
[email protected]
");
mail.From = new MailAddress("
[email protected]
");
mail.Subject = "This mail is send from asp.net application";
mail.SubjectEncoding = System.Text.Encoding.UTF8;
mail.Body = "This is Email Body Text";
mail.BodyEncoding = System.Text.Encoding.UTF8;
mail.IsBodyHtml = true;
mail.Priority = MailPriority.High;
SmtpClient client = new SmtpClient();
client.Credentials = new System.Net.NetworkCredential("
[email protected]
", "*****");
client.Port = 587;
client.Host = "smtp.gmail.com";
//client.EnableSsl = true;
SmtpClient smtp = new SmtpClient();
smtp.SendCompleted += new SendCompletedEventHandler(smtp_SendCompleted);
smtp.Send(mail);
try
{
client.Send(mail);
//Page.RegisterStartupScript("UserMsg", "<script>alert('Successfully Send...');if(alert){ window.location='SendMail.aspx';}</script>");
string strAlertMessage = "Mail Send succesfully";
ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('" + strAlertMessage + "');", true);
}
catch(Exception ex)
{
Console.Write(ex);
}
Reply
Answers (
5
)
how to use java script ckeditor validation in mvc
my ckeditor in mvc not work properly