本文介绍了邮件发送问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi


im从asp.net发送邮件非常好用于rediffmail和yahoo但是在gmail邮件上没有发送



我的代码是: -



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:-

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;
       }

推荐答案


这篇关于邮件发送问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 00:46