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
sameer shaikh
NA
177
38k
Send Email from Console/Asp.net application
Sep 1 2016 5:24 AM
Hi
Once again
i am trying to send email by using console application and i have tried following way
MailMessage mail = new MailMessage();
mail.From = new MailAddress("MyEmailAddress", "sameer shaikh");
mail.To.Add(new MailAddress("
[email protected]
"));
mail.Subject = "hi";
mail.SubjectEncoding = System.Text.Encoding.UTF8;
mail.Body = "this is body area of that email";
mail.IsBodyHtml = true;
mail.Priority = MailPriority.High;
SmtpClient client = new SmtpClient("smtp.gmail.com",587);
client.Credentials = new NetworkCredential("MyEamilAddress", "xxxxxxxxxx");
client.EnableSsl = true;
//client.UseDefaultCredentials = false;
try
{
client.Send(mail);
Console.WriteLine("send email successfully");
}
catch(Exception ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine("sending failed...");
}
but still getting error server does not support secure connections.
I tryied EnableSssl to false but not done.
please let me know where i am wrong and what is right solution for such problem.
Thanks&Regards
sameer
Reply
Answers (
4
)
how to hide next button on last page or dive using jquery
How to define session in runtime expire during runtime