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
Suresh Babu
NA
141
18.9k
mail was not sent after hosting the aplication
Sep 14 2013 7:32 AM
hi
plese help me
i had developed a web application.. in my application i need to sent a mail to customer.. if i run my application in local system its the mail was sent successfully. but after hosting the application the mail was not sent
this is my code
SmtpClient client = new SmtpClient();
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.EnableSsl = true;
client.Host = "smtp.gmail.com";
client.Port = 587;
System.Net.NetworkCredential credentials =
new System.Net.NetworkCredential("
[email protected]
", "suresh57");
client.UseDefaultCredentials = false;
client.Credentials = credentials;
MailMessage msg = new MailMessage();
msg.From = new MailAddress("
[email protected]
");
msg.To.Add(new MailAddress(to));
string BccAddress = "
[email protected]
";
msg.Bcc.Add(BccAddress);
msg.Subject = subject;
msg.Body = body;
try
{
client.Send(msg);
res = true;
}
catch (Exception ex)
{
}
Reply
Answers (
2
)
how to get URL Referrer when page has been redirected as par
How to execute stored procedure in winforms ?