Slow send with large attachment

0 votes
asked Oct 24, 2018 by FrancescoBo (120 points)

I'm trying to send an email with a 20 Mb attachment and this takes more than 2 minutes to do it.
Is this normal?

this is my send code:

Smtp smtp = new Smtp();
smtp.LogWriter = new FileLogWriter("log.txt", LogLevel.Debug);
smtp.Connect("serverName", 5264, SslMode.Implicit);
smtp.Login("Username", "Password");
smtp.Settings.SkipContentTransferEncodingCheck = true;

I have noticed this in the log file:

2018-10-24 18:03:31.526 INFO Smtp(1)[1] Response: 354 End data with <CR><LF>.<CR><LF>
2018-10-24 18:05:03.219 INFO Smtp(1)[1] Response: 250 2.0.0 Ok: queued as 42gFRR3LCpz2L1Hyh


1 Answer

+1 vote
answered Oct 25, 2018 by Lukas Pokorny (97,670 points)

Hi, this is not normal unless you have a very slow connection. However, this is unlikely to be caused by an SMTP client. Do you experience a similar delay when sending the same attachment through the same SMTP server using a third-party mail agent (such as Thunderbird)?

commented Oct 26, 2018 by Lukas Pokorny (97,670 points)
Can you please try this using the latest release of Rebex Secure Mail (2018 R3) and post a log for comparison? The latest version sends e-mail data in larger blocks, which might enhance transfer speed on connections where higher number of packets causes issues.
commented Nov 27, 2018 by christian.harter (230 points)
Hallo Lukas,

is this issue resolved?

I've got the same problems when sending larger attachments over some smtp servers. Sending a 2 MB attachment takes 3 minutes while sending with .NET SmtpClient takes only about 10 seconds. When trying this on our own exchange server there are no differences in time between Rebex Secure Mail and .NET SmtpClient. Both are very fast.

Is this a known issue?
I use the latest release of Rebex Secure Mail (2018 R3).

Thank you and best regards,
commented Nov 27, 2018 by Lukas Pokorny (97,670 points) 1 flag
The user who reported this issue never got back to us, so we were unable to look into it.
But since you are already using the latest version, please give this a try:

1) Try to disable chunking, pipelining, and both before sending the message and let us know whether this has any effect:
    smtp.EnabledExtensions &= ~SmtpExtensions.Pipelining;
    smtp.EnabledExtensions &= ~SmtpExtensions.Chunking;

2) If this doesn't help, create a communication log using LogWriter property (see the code above) and either post it here or mail it to for analysis.

commented Nov 27, 2018 by christian.harter (230 points)
Thank you very much... disable chunking works. Disable pipelining has no effect.

Best wishes,
commented Nov 28, 2018 by Lukas Pokorny (97,670 points)
Thanks for letting us know! I guess that .NET SmtpClient doesn't use chunking extension either.