发送电子邮件失败 - Smtp例外 [英] Send email failed - Smtp Exception
本文介绍了发送电子邮件失败 - Smtp例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用 https://support.gearhost.com/entries上的代码/ 23715048-ASP-NET-form-to-email-example [ ^ ],我使用有效的电子邮件地址修改了代码,并且
SmtpClient客户端=新的SmtpClient(mail.myCompany.com) );
当我运行它时,得到一个InnerException:远程名称无法解析:'mail.myCompany.com'。
我出了什么问题做?谢谢,如果你能提供帮助。
Using the code at https://support.gearhost.com/entries/23715048-ASP-NET-form-to-email-example[^], I revised the code with a valid email address and
SmtpClient client = new SmtpClient("mail.myCompany.com");
When I run it it, got an InnerException: "The remote name could not be resolved: 'mail.myCompany.com'".
What was wrong I did? Thanks if you can help.
推荐答案
我重新检查并认为失败可能与防火墙有关。我使用了来自 http://social.msdn.microsoft.com/Forums/en-US/95857c70-5af4-4075-9f1e-14134fec7be6/open-default- email-program-outlook-for-example-when-pressing-a-link?forum = vblanguage [ ^ 一>]。通过推出我们公司的Outlook,这段代码运作良好。感谢评论者。
I re-checked and believed that the failure could be Firewall related. I used another piece of code sourced from http://social.msdn.microsoft.com/Forums/en-US/95857c70-5af4-4075-9f1e-14134fec7be6/open-default-email-program-outlook-for-example-when-pressing-a-link?forum=vblanguage[^]. This piece of code works well by launch our company's Outlook. Thanks to reviewers.
无法解析远程名称
在命令提示符下,尝试 ping mail.mycompany.com 并查看DNS是否正确解析了该名称。
同时检查您机器的DNS配置。
The remote name could not be resolved
In a command prompt, try to ping mail.mycompany.com and see if this name is correctly resolved by DNS.
Check also the DNS configuration of your machine.
这篇关于发送电子邮件失败 - Smtp例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文