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
Shubham Agrawal
1.5k
218
6.9k
how to send mail
Sep 20 2017 3:48 AM
This Code is using For Sending Mail
but i Dont Sent the mail. Can anyone help Me ASAP.
using (MailMessage mail = new MailMessage())
{
mail.From = new MailAddress("
[email protected]
");
mail.To.Add(textbox3.Text);
mail.Subject = "Random Password for your Account";
mail.Body = "You Are Successfully Register...!!!\n\nDear " + textbox1.Text + "," + "\n" + strNewPassword + "," +
"\n\tThank you registering for Onlile Shopping As A Member." +
"\nIf you have any query please contact 8319058205." +
"\nThank you and Have a nic Day....!" +
"\n\n[Mr.Shubham Agrawal]";
mail.IsBodyHtml = false;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.EnableSsl = true;
NetworkCredential networkCredential = new NetworkCredential();
networkCredential.UserName = "
[email protected]
";
networkCredential.Password = "*******";
smtp.UseDefaultCredentials = true;
smtp.Credentials = networkCredential;
smtp.Port = 587;
smtp.Send(mail);
ClientScript.RegisterStartupScript(GetType(), "alert", "alert('Message has been sent successfully.');", true);
}
Reply
Answers (
6
)
Crystal Report in Visual Studio 2015
Page not response on server after few times minuts