SMTP邮件无法从客户端PC工作 [英] SMTP Mail not working from client pc

查看:156
本文介绍了SMTP邮件无法从客户端PC工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Windows应用程序,用于发送SMTP电子邮件.它可以在我的PC上正常运行,但不能在其他PC上运行.我正在使用的代码是:

I have a windows application that sends an SMTP email. It works fine from my pc but it does not from another. The code I''m using is:

string body = "my message" + txtFriendName.Text + Environment.NewLine +
      Environment.NewLine + " my url link - " + "http://www.mywebsite.com";
MailMessage email = new MailMessage("sender email", txtFriendEmail.Text, txtName.Text + "subject", body);

SmtpClient SmtpMail = new SmtpClient("smtp.fasthosts.co.uk", 25);
SmtpMail.Credentials = new NetworkCredential("sender email", "password");
SmtpMail.EnableSsl = false;
SmtpMail.Send(email);





Any ideas why it does not work from any pc?

推荐答案

客户端计算机可能具有阻止传出SMTP的防火墙,或者该防火墙可能位于他的网络网关/路由器.在某些情况下,特别是在家庭连接中,ISP也不允许传出SMTP(我在美国的Comcast和加拿大的Rogers遇到了这个问题).
The client machine may have a firewall that blocks outgoing SMTP, or the firewall may be on his network gateway/router. In some cases, specially with home connections, ISPs do not permit outgoing SMTP either (I have had this problem with Comcast in the US and Rogers in Canada).


什么不起作用?将您的代码放在try/catch块中,看看引发了什么异常.这可能会给您一个提示.如果没有,请使用相关信息更新您的问题.
What is not working? put your code in try/catch block and see what is throwing exception. That might give you a hint. If not update your question with relevant information.


这篇关于SMTP邮件无法从客户端PC工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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