views:

57

answers:

4

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

+1  A: 

Depending on what/why McAfee is flagging it, more than likely you will not be able to get around it.

You will want to see if you can find out if McAfee is flagging it due to the port being used, or if there is any other information as to why the individual message is not going.

Mitchel Sellers
exception throw is not really helpful. But i know its mcafee, on another computer where I can disable it in registries, it works.
Pierluc
My guess is that McAfee is blocking the SMTP port as it doesn't expect your application to send the message.
Mitchel Sellers
can I bypass it?
Pierluc
Not without modifying the rules
Mitchel Sellers
A: 

No. And yes.

No, you can't force McAffee to not flag your email from code, if that's what you mean.

Yes, you can prevent McAffee or other virus scanners from flagging your emails as suspicious. Here are a couple of things I try to make sure of:

  • That your all addresses (especially from: and reply-to:) are valid.

  • That the the name you're sending from is actually the name of a the correct person in your active directory.

You could also ask your system administrators to put your "from:" address on a global whitelist so that it always goes to the client.

Are you attaching executables? Are you sure you aren't attaching any viruses? ;-)

Dave Markle
theres not any attachements. I'Ve tried to change the from and replyto to valid adresses and still didn't work. "Failure sending mail".I've tried it on another comptuer where mcafee could be disabled and it worked.Any other ideas?
Pierluc
is there a COM solution I could use to bypass this?
Pierluc
Nope. Sounds like you need to ask McAffee support or your sysadmin what exactly is going on...
Dave Markle
A: 

From what I recall, I think McAfee has a list of programmes that are allowed to send emails, if your program is not added to this list, then your emails will not get sent.

This is a big support problem, as you will find your customers have a 101 different virus checkers all setup in different ways.

You may be able to setup a email server to use a none standard port, then send emails to that port.

For testing, attaching to the McAfee process with a debugger and then killing it can work well...

Ian Ringrose
A: 

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.
GvS
First bullet could be a good solutions, however, I do not want the outlook to open. Is there a way that when mailto: is executed it sends out the email on the fly.
Pierluc
There ya go, I digged a little bit more for sending it via outlook, and it works well.http://keithelder.net/blog/archive/2007/01/11/WinForm-Programming-Send-Email-Using-Outlook-Interop-or-System.Diagnostics.Process.aspx
Pierluc