Search code examples
c#.netemailblockingantivirus

Prevent Anti-Virus to block outgoing email with C#


I have an application with a static class that is capturing all errors that happens during the runtime (if its the case) and when process is done, it sends out an email with the list of errors so I or any other developers can address those errors.

However my problem is that McAfee is blocking the request, as if it was a kind of virus. I do not have rights on my machine to edit McAfee settings, is it possible to fix it through C# code?

Thank you


Solution

  • Probably McAfee is blocking outgoing connections on port 25 (SMTP), only allowing a white list of applications to send email.

    What you can do is:

    • Put the email in a mailto:// url. Execute the mailto:// as if it is a normal command line. This will ask for input from the user, but you can create a nice template for the user. (syntax)
    • Send the email through your normal email client (Outlook, Notes), if they have an API for that.
    • Use a Http/Web based provider that has an API. Public ones are probably also blocked by McAfee. But you could create & host a service yourself. Be very carefull to only allow traffic from within your company.
    • Maybe you company has a "drop folder", where you can drop emails that are picked up by the email server.