尝试使用mandrill mailchimp发送电子邮件时出现异常故障? [英] I getting an exception failure when trying to send an email using mandrill mailchimp?

查看:143
本文介绍了尝试使用mandrill mailchimp发送电子邮件时出现异常故障?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

回答
ServicePoint,Address ='smtpClient.ServicePoint.Address'抛出类型'System.NotSupportedException'的异常,





i得到这个例外..



我尝试过:



< pre> 
string SMTP_HOST =smtp.mandrillapp.com;
string SMTP_PORT =587;
bool enableSSL = true;
try
{
System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
mail.To.Add(ToEmail);
mail.From = new MailAddress(mymailid,FromName,System.Text.Encoding.UTF8);
mail.ReplyTo =新邮件地址(FromEmail,FromName,System.Text.Encoding.UTF8);
//webmail.Subject =主题;
mail.Subject =主题;
mail.SubjectEncoding = System.Text.Encoding.UTF8;
mail.Body = MailBody;
mail.BodyEncoding = System.Text.Encoding.UTF8;
mail.IsBodyHtml = true;
mail.Priority = MailPriority.High;
SmtpClient客户端=新的SmtpClient();
client.Credentials = new System.Net.NetworkCredential(mymailid,mypassword);
client.Port = Convert.ToInt16(SMTP_PORT);
client.Host = SMTP_HOST;
client.EnableSsl = enableSSL;
client.Send(mail);
返回true;

}
catch
{
return false;
}

解决方案

这看起来是加密实施的问题,类似于这个问题

https://www.codeproject.com/Messages/5415417/ServicePoint- Address-equals-smtpClient-ServicePoin.aspx



如果你真的使用了 C#4.0 ,那么你就是唯一的可用的传输方法是SSL和TLS 1.0;哪些都是过时的。

支付卡行业几年前要求放弃这些以支持更安全的TLS方法。

MailChimp遵循PCI标准,不再支持SSL或TLS 1.0

https://github.com/anymail/django-anymail/ issue / 105



建议的路径是升级.NET Framework的版本

https://docs.microsoft.com/en-us/dotnet/framework/network-programming/tls

Answer
ServicePoint, Address = 'smtpClient.ServicePoint.Address' threw an exception of type 'System.NotSupportedException',



i get this exception..

What I have tried:

<pre>  
                string SMTP_HOST = "smtp.mandrillapp.com";
            string SMTP_PORT = "587";
            bool enableSSL = true;
            try
                {
                System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
                mail.To.Add(ToEmail);
                mail.From = new MailAddress("mymailid", FromName, System.Text.Encoding.UTF8);
                mail.ReplyTo= new MailAddress(FromEmail, FromName, System.Text.Encoding.UTF8);
                //webmail.Subject = Subject;
                mail.Subject = Subject;
                mail.SubjectEncoding = System.Text.Encoding.UTF8;
                mail.Body = MailBody;
                mail.BodyEncoding = System.Text.Encoding.UTF8;
                mail.IsBodyHtml = true;
                mail.Priority = MailPriority.High;
                SmtpClient client = new SmtpClient();
                client.Credentials = new System.Net.NetworkCredential("mymailid", "mypassword");
                client.Port = Convert.ToInt16(SMTP_PORT);
                client.Host = SMTP_HOST;
                client.EnableSsl = enableSSL;
                client.Send(mail);
                return true;

            }
            catch
                {
                    return false;
                }

解决方案

This looks to be a problem with your encryption implenatation, similar to this issue
https://www.codeproject.com/Messages/5415417/ServicePoint-Address-equals-smtpClient-ServicePoin.aspx

If you truly are using C# 4.0 as you have tagged, the only available transport methods are SSL and TLS 1.0; which are both obsolete.
The Payment Card Industry mandated several years ago to abandon these in favor of more secure TLS methods.
MailChimp has followed the PCI standards and no longer supports SSL or TLS 1.0
https://github.com/anymail/django-anymail/issues/105

The recommended path would be to upgrade the version of the NET Framework
https://docs.microsoft.com/en-us/dotnet/framework/network-programming/tls


这篇关于尝试使用mandrill mailchimp发送电子邮件时出现异常故障?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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