Control Panel
Forum
Hosting Help
ASP.NET 4 & SQL 2008 R2 Hosting
Resources
Notice
Login
Members
Shared Hosting
|
Upgrade
|
Advertise
|
Tutorials
|
AdSense revenue sharing sites
|
Exam 70-680 Practice Tests
|
Silverlight games
Total
members
:
210364
Average new registrations per day (in last 7 days):
16
New Registration:
Open
Register Now
Home
»
Questions & Answers
»
mail sending by gmail...working on local host ..but not on webhost
mail sending by gmail...working on local host ..but not on webhost
4/8/2010
Author:
Farzana Rashid
http://aspspider.info/farzanarashid
Test Website Farzana
hello,
i have following code in my asp.net web app to send mail
////////////////////////
SmtpClient client = new SmtpClient();
client.Host = smtp.gmail.com;
client.Port = 587;
client.UseDefaultCredentials = true;
client.Credentials = new System.Net.NetworkCredential(me@gmail.com, mypswd);
client.EnableSsl = true;
MailAddress sendfrom = new MailAddress(someone@gmail.com);
MailAddress sendto = new MailAddress(send_email);
MailMessage message = new MailMessage(sendfrom, sendto);
message.To.Add(someone@yahoo.com);
message.Subject = Order Received;
message.Body = msgbody.ToString();
message.IsBodyHtml = true;
message.Priority = MailPriority.High;
client.Send(message);
/////////////////////////////////////////////////////
the code is working perfectly one my local host but when uploaded on webhost...no mails are received and no error is generated either...
any help will be greatly appreciated.
Answers .............
Author:
Harsh Shah
Ahmedabad Institute of Technology
Posted Date: 4/17/2010
Remove the line -
client.UseDefaultCredentials = true;
You must
login
to post answer for this question.
Advertise
Privacy Policy
Terms of use
Contact Us
SpiderWorks Technologies Pvt Ltd.
All Rights Reserved.