如何让迈克菲从我的工作站发送邮件变得很酷?

发布于 2024-10-25 05:54:09 字数 1355 浏览 5 评论 0原文

我正在开发一个服务器应用程序,它必须偶尔发送邮件以通知用户。

MailMessage mm = new MailMessage();

mm.To.Add("[email protected]");
mm.From = new MailAddress("[email protected]");
mm.Subject = "J/K";
mm.Priority = MailPriority.Normal;
mm.IsBodyHtml = false;
mm.Body = "Greetings and salutations";

SmtpClient client = new SmtpClient("host.address.lcl");
client.Send(mm);

如果我将应用程序放在实际的服务器上,它可以正常工作,但在我的工作站上,根据我访问代码的方式,它要么默默地失败,要么引发异常。无论哪种情况,都会生成 McLogEvent:

Blocked by port blocking rule (Anti-virus Standard Protection:Prevent 
mass mailing worms from sending mail).

...并且例外情况是:

System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: 
Unable to connect to the remote server ---> System.Net.Sockets.SocketException: 
No connection could be made because the target machine actively refused it [IP & Port Numbers] 

看起来我的工作站上的规则正在努力阻止直接或间接生成邮件,但我不确定如何处理“积极拒绝”部分,因为如果 McLogEvent 文本似乎暗示它不会走那么远。

我应该指出,如果我使用 System.Web.Mail 它效果很好。当然,缺点是有关此名称空间的编译器消息已被弃用,取而代之的是 System.Net.Mail。

有人知道如何让迈克菲从我的工作站发送邮件变得更酷吗?

I am developing an application for a server and it must send mail occasionally for notifications to users.

MailMessage mm = new MailMessage();

mm.To.Add("[email protected]");
mm.From = new MailAddress("[email protected]");
mm.Subject = "J/K";
mm.Priority = MailPriority.Normal;
mm.IsBodyHtml = false;
mm.Body = "Greetings and salutations";

SmtpClient client = new SmtpClient("host.address.lcl");
client.Send(mm);

If I put the app on an actual server it works fine, but on my workstation, depending upon how I access the code, it either silently fails or throws an exception. In either case a McLogEvent is generated:

Blocked by port blocking rule (Anti-virus Standard Protection:Prevent 
mass mailing worms from sending mail).

...and the exception says:

System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: 
Unable to connect to the remote server ---> System.Net.Sockets.SocketException: 
No connection could be made because the target machine actively refused it [IP & Port Numbers] 

It looks like a rule on my workstation is working to keep the mail from being generated, directly or indirectly, but I'm not sure what to make of the "actively refused it" part, since if the McLogEvent text seems to suggest that it wouldn't get that far.

I should point out that if I use System.Web.Mail it works great. The drawback being of course compiler messages about this namespace being deprecated in favor of System.Net.Mail.

Anyone have any idea of how to make McAfee cool with sending mail from my workstation?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

绿光 2024-11-01 05:54:09

右键单击 McAfee 图标,从系统托盘打开 McAfee 控制台,然后选择 VirusScan Console

查看“任务”、“访问保护”下的属性

取消选中阻止端口 25 上传出消息的规则。

编辑 - 异常表明它被主动拒绝只是因为McAfee 不允许您在端口 25 上与任何端口建立连接,因此例外情况只是认为您尝试的主机在 25 端口上没有任何内容,或者防火墙阻止了 25 端口。

值得指出的是,如果您在公司上如果您正在运行 McAfee 企业版,则该设置的配置级别可能高于您的系统,因此您可能无法更改它 - 如果是这种情况,请与您的系统管理员联系。

Open mcafee console from the sys tray by right clicking on the McAfee icon and select VirusScan Console

View the properties under Task, Access Protection

Uncheck the rule that blocks outgoing messages on port 25.

edit - the exception saying that it was actively refused is just because McAfee isn't allowing you to make the connection on port 25 to anything, so the exception just thinks you tried a host which didn't have anything on 25 or had a firewall blocking 25.

It's worth pointing out that if your on a corporate network and you're running the enterprise version of McAfee, the setting may be configured at a higher level than your system, so you may not be able to change it - speak to your sysadmin if this is the case.

青巷忧颜 2024-11-01 05:54:09

这取决于您是否处于运行 EPO (McAfee ePolicy Orchestrator) 的环境中,或者您的防病毒软件是否是独立的。如果是 EPO,那么您需要在 EPO 控制台中解锁您的工作站(和可执行程序)。

It depends if you're in an environment running EPO (McAfee ePolicy Orchestrator) or if your anti-virus is standalone. If EPO then you'll need to have your workstation (and program executable) unblocked in the EPO console.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文