猿问

关于邮件发送问题

public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            send("chenghai", "项目通知发送成功!", "有关OA详细内容查看");
        }
        public void send(string to, string subject, string content)
        {
            try
            {
                string fromEmail = "项目管理系统<public@xx.net.cn>";
                string toEmail = to + "@163.com";
                System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient(System.Configuration.ConfigurationManager.AppSettings["webmail"].ToString());
                client.UseDefaultCredentials = false;
                client.Credentials = new System.Net.NetworkCredential("public", "public");
                client.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
               
                
            }
            catch
            {

            }

邮件发送不了 ,catch :邮件发送失败,-------{"无法连接到远程服务器"}

如果你们又相关代码粘出来 给我啊  ,


开满天机
浏览 302回答 2
2回答

30秒到达战场

未设置pop3和主机密码
随时随地看视频慕课网APP
我要回答