Tech
Forums
Jobs
Books
Events
Live
Interviews Prep
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
Mail Message in Window form application
M CH
Feb 17 2016 2:53 AM
325
Reply
Dear Sir,
I have a code for mail message in window form application but I get exception error after running. Code is here
private void buttonSend_Click(object sender, EventArgs e)
{
try
{
MailMessage mail = new MailMessage(textBoxFrom.Text, textBoxTo.Text, textBoxSubject.Text, richTextBoxMsgBody.Text);
SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587);
smtp.Credentials = new System.Net.NetworkCredential(textBoxOwnE.Text, textBoxPass.Text);
smtp.EnableSsl = true;
smtp.Send(mail);
MessageBox.Show("Your e-mail is sent suuccessfully!", "Message Sent", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Please help me . I shell be very thankful to you for this kindness.
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
How to add bullets in table colmns field?
textbox size shrinks