无法解析远程名称

无法解析远程名称

本文介绍了无法解析远程名称:'smtp.gmail.com'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

protected void btnSubmit_Click(object sender, EventArgs e)
    {

        MailMessage Msg = new MailMessage();
        Msg.From = new MailAddress("[email protected]");
        Msg.To.Add(txtToMail.Text);
        //Msg.Subject = txtSubject.Text;
        Msg.Body = txtSubject.Text;
        Msg.IsBodyHtml = true;

        SmtpClient smtp = new SmtpClient();
        smtp.Host = "smtp.gamil.com";
        System.Net.NetworkCredential NetworkCred = new System.Net.NetworkCredential();
        NetworkCred.UserName = "lathag3093gmail.com";
        NetworkCred.Password = "";
        smtp.UseDefaultCredentials = true;

        smtp.Credentials = NetworkCred;
        smtp.Port = 587;
        smtp.EnableSsl = true;
        smtp.Send(Msg);
        lblMsg.Text = "Email has been successfully sent..!!";



    }





我的尝试:



..这个错误我得到了..任何人都建议我解决问题



What I have tried:

..This error I got..Can anyone suggest me to solve the problem

推荐答案

smtp.Host = "smtp.gamil.com";


smtp.Host = "smtp.gmail.com";
 smtp.Timeout = 10000;


这篇关于无法解析远程名称:'smtp.gmail.com'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-24 06:02