Results 1 to 2 of 2

Thread: [3.0/LINQ] SMTP fails someof the time

  1. #1

    Thread Starter
    Fanatic Member Crash893's Avatar
    Join Date
    Dec 2005
    Posts
    930

    [3.0/LINQ] SMTP fails someof the time

    Okay i got a weird one for you

    we have a open smtp server here in the building for sending out alerts and whatnot

    I can send from my machine and get an email
    My cube mate can send from his machine and i get the email ( they are currently all addressed to me)


    If i log on to a machine in my computer lab it doenst work for me
    If i other people from my same group ( that have the same AD permissions) with the exception of the one guy they get an error



    Code:
    System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine 10.209.xx.xx:xx


    Here is the code i am using

    C# Code:
    1. private static void UsatSendMail(string[] To, string From, string Subject, string Message)
    2.         {
    3.             SmtpClient server = new SmtpClient("usat-xxxxx");
    4.             server.Credentials = new NetworkCredential("user", "pass");
    5.             MailMessage email = new MailMessage();
    6.             email.From = new MailAddress(From);
    7.             foreach (string T in To)
    8.             {
    9.                 email.To.Add(T);
    10.             }
    11.             email.Subject = Subject;
    12.             email.Body = Message;
    13.             try
    14.             {
    15.                 server.Send(email);
    16.                 MessageBox.Show("Page Sent");
    17.             }
    18.             catch (SmtpFailedRecipientException error)
    19.             {
    20.                 MessageBox.Show("error: " + error.Message + "\nFailing recipient: " + error.FailedRecipient);
    21.                 //LogFile();
    22.             }
    23.  
    24.             catch (Exception ex)
    25.             {
    26.                 MessageBox.Show(ex.Message);
    27.                 //LogFile();
    28.             }

    Ive also tried making it a clickonce install package to insure the other people have all the nesscary pre reqs ( .net3.5)


    I'm really at a loss as to why it works in some situations and not in others.

    If anyone has any idea on what i could look for that might explian this That would be really helpful.

  2. #2

    Thread Starter
    Fanatic Member Crash893's Avatar
    Join Date
    Dec 2005
    Posts
    930

    Re: [3.0/LINQ] SMTP fails someof the time

    Resolved

    It was Mcafee virus

    Some people in the company have the new version which blocks smtp and I have an older version.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width