错误:服务器不支持安全连接 [英] Error: Server does not support secure connections

查看:1157
本文介绍了错误:服务器不支持安全连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我一直在使用下面的脚本超过现在开始的一年,从我的主机发送电子邮件(通过Gmail),它已只是正常工作(在 Settings.Get()刚刚回归字符串):

Ok, I have been using the following script for over a year now to send email (via gmail) from my host, and it has worked just fine (the Settings.Get() just return strings):

public class Email : SmtpClient
{
    public MailMessage Message { get; private set; }

    public Email(string to, string from, string subject, string body) : base(Settings.Get("smtp"), 25)
    {
        this.EnableSsl = Convert.ToBoolean(Settings.Get("ssl"));
        if(this.EnableSsl)
            this.Credentials = new System.Net.NetworkCredential(Settings.Get("gm"), Settings.Get("gmp"));
        this.Message = new MailMessage(from, to, subject, body);
    }

    public void Send()
    {
        try { this.Send(Message); }
        catch (Exception ex) { throw ex; }
    }
}

不过,从昨天开始,我已经收到此错误:

But, since yesterday, I have been getting this error:

错误:服务器不支持安全连接

现在当然我的主人认为这不是他们的错,但我并没有改变任何东西。此外,它仍然工作在我的本地和测试机器的罚款。任何想法可能会导致这个,所以我可以告诉他们要修复它?

Now of course my host thinks it's not their fault, BUT I DIDN'T CHANGE ANYTHING. Also, it still works fine on my local and test machines. Any idea what might be causing this so I can tell them to fix it?

感谢您......这是推动我疯了!

Thank you... this is driving me nuts!

推荐答案

什么SMTP服务器和端口您使用的?您将需要使用端口465或587,如果您直接连接到smtp.gmail.com发送邮件SSL。

What SMTP-Server and port are you using? You will need to use port 465 or 587 if you are connecting directly to smtp.gmail.com to send ssl mail.

它看起来像您正在使用端口25,你确定你的 Settings.Get(SSL)返回false?

It looks like you are using port 25, are you sure that your Settings.Get("ssl") returns false?

阅读此处了解详情。

这篇关于错误:服务器不支持安全连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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