gmail没有使用smtp回复。 [英] gmail not reciving using smtp.

查看:101
本文介绍了gmail没有使用smtp回复。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

i曾经用c#在Asp.net开发我的应用程序。

但是在这方面我对我的联系页面几乎没有疑问。

那一刻,我想用smtp发送电子邮件。

但在我的情况下,发送选项工作正常而没有任何问题。

但事情是我已经提到收件人邮件ID到密件抄送。

问题我声明,如果我已经将收件人邮件ID作为雅虎id或任何其他微软ID,那么它的工作正常发送邮件和收到但是当我给了gmail id时,它发送邮件但没有收到任何邮件。



请在下面找到我的代码并帮助我。

Hi all,
i have used to developed my application in Asp.net with c#.
But in this i have few doubts regarding my contact page.
the moment, i wanted to send email using smtp.
But in my case the sending options has working fine without getting any issues.
But the thing is i have mentioned recipients mail id to Bcc.
the problem i state that if i have given recipient mail id as yahoo id or any other microsoft id then its working fine to send mail and recieved but when i have given gmail id, it was sending to mail but not receive any mail.

please find the below my code and do help me.

public string sendmail(string from, string to, string cc, string bcc, string subject, string body)
    {
        try
        {
            MailMessage mMailMsg = new MailMessage();
            mMailMsg.From = new MailAddress(from);
            mMailMsg.To.Add(new MailAddress(to));

            if (cc != null || cc != string.Empty)
            {
               // mMailMsg.CC.Add(new MailAddress(cc));
            
            }
            mMailMsg.Bcc.Add(new MailAddress("xxxx@gmail.com"));
          
            
            mMailMsg.Subject = subject;
            mMailMsg.Body = body;
            mMailMsg.IsBodyHtml = false;

            mMailMsg.Priority = MailPriority.Normal;
            SmtpClient msmtp = new SmtpClient();        

            //msmtp.EnableSsl = true;
            msmtp.Send(mMailMsg);
            return "";
        }
        catch (Exception ex)
        {
            return ex.ToString();
        }
    }









谢谢提前....





thanks to advance....

推荐答案

登录您正在使用的Gmail帐户。第一次开始这个gmail标记你的帐户,你必须登录,并有一个选项,通过这种方法启用发送。



基本上他们看到你使用要发送的外部应用程序,他们希望您验证它确实是您。
Log into the gmail account that you are using. The first time you start doing this gmail flags your account and you have to login and there is an option to enable sending via this method.

Essentially they see you using an external application to send and they want you to verify that it really is you.


这篇关于gmail没有使用smtp回复。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆