分享

写回答

发帖

[提问] godaddy win主机 不能用程序发送邮件????

GoDaddy GoDaddy 1018 人阅读 | 4 人回复

发表于 2011-5-7 16:25:18 | 显示全部楼层 |阅读模式

求解!!
我的发送Email代码:
//发送邮件
        public static void SendEmail(string UserEmail, string Title, string Content)
        {
            string Poster = "maishuo2009@gmail.com";
            string PosterPwd = "";
            SmtpClient client = new SmtpClient("smtp.gmail.com");

            client.UseDefaultCredentials = false;
            client.Credentials = new System.Net.NetworkCredential(Poster, PosterPwd);
            client.DeliveryMethod = SmtpDeliveryMethod.Network;
            MailMessage message = new System.Net.Mail.MailMessage(Poster, UserEmail, Title, Content);//发件人地址,收件人地址,邮件标题,邮件内容

            message.BodyEncoding = System.Text.Encoding.UTF8;
            message.IsBodyHtml = true;

            //使用Gmail时打开
            client.Port = 587;
           client.EnableSsl = true;

            client.Send(message);
        }


本地测试没问题 但是传到 GD的主机上就报错!!!
错误代码:
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

回答|共 4 个

微微百科

发表于 2011-5-7 16:35:57 | 显示全部楼层

估计是从安全的角度来考虑,他们的服务器上不允许运行这样的程序。
具体的错误原因,你可以在“web.config”文件中添加一个 <customErrors> 标记来查看。

maishuo

发表于 2011-5-7 17:14:56 | 显示全部楼层

godaddy     支持System.Net.Mail吗?

微微百科

发表于 2011-5-7 17:19:42 | 显示全部楼层

回复 3# 的帖子

具体不太清楚,你可以咨询一下Godaddy官方。

lwbo1987

发表于 2011-5-7 17:56:32 | 显示全部楼层

回复 3# 的帖子

这个不清楚,需要联系godaddy客服
您需要登录后才可以回帖 登录 | 注册

本版积分规则