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
Muhammad Nadeem
NA
548
65.8k
Mail message in Web Application
Apr 28 2016 12:10 AM
This is my code but I get exception error why because my all code is to the point and correct.
protected void ButtonSend_Click(object sender, EventArgs e)
{
try
{
MailMessage mail = new MailMessage(TextBoxFrom.Text, TextBoxTo.Text, TextBoxSubject.Text, TextBoxBody.Text);
SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587);
smtp.Credentials = new System.Net.NetworkCredential(TextBoxEmail.Text, TextBoxPassword.Text);
smtp.EnableSsl = true;
smtp.Send(mail);
Response.Write("Message sent successfully!");
}
catch (Exception ex)
{
Response.Write(ex.Message + " Some error's !");
}
}
Please teach me. Thanks a lot.
Reply
Answers (
5
)
c# book(learning)
Html styles are not applied to pdf in c#