Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
3
Reply
Sending until Progressbar processing...
Israel
Jun 1 2016 9:53 AM
345
Reply
Hi!
I wrote this code for sending my email. Its works!
But after to click to my button to send the content. Its make some seconds until sending completly. I need to insert a processBar into my StatusStrip (processing with a counter 1,2,3,4,5,etc) for example in wating the email to be sended totally. Its means when its end down at 100%. Its sended!
This my code:
try
{
SmtpClient client = new SmtpClient("smtp.live.com", 25);
NetworkCredential cred = new NetworkCredential("emailFrom", "password");
MailMessage Msg = new MailMessage();
Msg.From = new MailAddress(txtEmailFrom.Text);
Msg.To.Add(txtEmailTo.Text);
Msg.Subject = txtEmailSubject.Text;
Msg.Body = txtEmailContent.Text;
client.Credentials = cred;
client.EnableSsl = true;
lblConfirmation.Text = "Mail Sended Succesfully";
client.Send(Msg);
}
catch{
lblConfirmation.Text = "Error";
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
GridView - remove border style for last column
Insert data from Front end to Back end