从Windows表单应用程序发送电子邮件 [英] Sending email from windows form application
本文介绍了从Windows表单应用程序发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我开发了一个Windows表单应用程序,用于向特定的电子邮件地址发送电子邮件。我已经编写了表单正确运行的代码,但是当我单击发送按钮时,它显示错误消息服务器不支持安全连接。我无法找出其背后的原因。请有人帮我完成我的项目。谢谢
Hi
I developed a Windows Form Application to send email message to a particular email address. I have written the code for that the form is running properly but while I click the send button it shows an error message as "Server does not supports secure connections". I am unable to find out the reason behind of it. Please somebody help me to complete my project. Thanks
推荐答案
您好,
试试这个:
Hi,
Try this:
smtpClient.EnableSsl = false; // change 'smtpClient' into the name of your SmtpClient
希望这有帮助。
Hope this helps.
请检查主题1 和主题2
请将以下代码添加到您的应用程序中。
Please check the thread 1 and thread 2
Please add the following code to your application.
System.Net.ServicePointManager.ServerCertificateValidationCallback = (s, certificate, chain, sslPolicyErrors) => true;
这篇关于从Windows表单应用程序发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文