Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi
i m sending mail from asp.net its working very fine to rediffmail and yahoo but on gmail mail is not sending

my code is:-

C#
public string sendMail1(string tomail, string id, string body1)
       {
           MailMessage mail = new MailMessage();

           mail.To.Add(tomail);
           mail.From = new MailAddress(mfrommail);
           mail.Subject = "Verification Mail ";



           mail.Body = body1;
           mail.IsBodyHtml = true;
           mail.Priority = MailPriority.High;
           SmtpClient smtp = new SmtpClient();


           smtp.Host = "mail.myservername.com";
           smtp.Port = 25;
           smtp.EnableSsl = false;

           smtp.UseDefaultCredentials = false;
           smtp.Credentials = new System.Net.NetworkCredential(mfrommail, mSenderCredentials);


           smtp.Send(mail);

           return script;
       }
Posted
Comments
Thanks7872 16-Jun-14 2:20am    
How you come to know that above code is not working? Did you get any error? Explain the issue clearly.
Miss Maheshwari 16-Jun-14 2:55am    
i tried it live on my site ; mail is sending on rediff/yahoo but not on gmail

1 solution

Hello friend, please check the spam folder of gmail account.

- DD
 
Share this answer
 
Comments
Miss Maheshwari 16-Jun-14 2:56am    
checked it already

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900