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
kritika Rana
NA
252
101.4k
email in C#
Aug 21 2013 1:48 AM
Hi
I have some code which sends email to specified person using gmail account but I want to send it with some other account .How to configure the code with other account.
The code is as below:'
private void SendMail(string fileContent)
{
MailMessage mailMessage = new MailMessage();
mailMessage.From = new MailAddress("
[email protected]
", "Kritika");
// mailMessage.To.Add("
[email protected]
");
// mailMessage.To.Add("
[email protected]
");
mailMessage.To.Add("
[email protected]
");
mailMessage.Subject = "Test Email";
mailMessage.IsBodyHtml = true;
mailMessage.Body = fileContent + "<br/> <br/> <br/>";
using (SmtpClient mailbox = new SmtpClient
("smtp.gamil.com", 587))
{
mailbox.Credentials = new NetworkCredential("
[email protected]
", "paswd");
mailbox.EnableSsl = true;
mailbox.Send(mailMessage);
}
}
what has to written in place of highlighted text to send email from
[email protected]
to specified person.
Reply
Answers (
11
)
combo box datetime picker
Why members of interface cannot be static?