none
[E2007SP1] [EWSMA] [C#]:Performance issue while sending an email with "large" attachment in C# using EWS Managed 1.1 RRS feed

  • Question

  • I'm facing a performance issue while sending an email with EWS Managed 1.1. For some reason, depending on the size of my attachment, when I send an email it takes... more or less time.

    Here is the results of the tests I performed:

    • 0Ko => 0.3s
    • 1Ko => 0.6s
    • 250Ko => 1s !
    • 512Ko => 60,1s !
    • 1024Ko => 60,6s

    As you can see, it seems that when the size of my attachment goes over ... some limit, it takes 1 additionnal minute to perform the send ! Does anyone have ever faced this problem?

    It doesn't seem to be a problem of the Excahnge server given that, from my Outlook client, I can send the same attachment much quicker.

    Here is the code I used:

    public static void SendMail(ExchangeService service, int size) 
    {
     EmailMessage message = new EmailMessage(service);
     message.Subject = "test subject";
     message.Body = "test body";
     message.ToRecipients.Add("fake@fake.com");
    
     message.Attachments.AddFileAttachment("test.txt", new byte[size]);
    
     message.Send();
    }
    

    Thanks.


    Tuesday, August 30, 2011 7:48 AM