iOS + SmtpClient + PickupDirectoryLocation + attachment = über slow?
Hello, everybody.
I tried to send an Email with a 10mb+ movie (.mov) attachment using the somewhat usual approach with MailMessage and SmtpClient classes form the System.Net.Mail namespace of Mono. It was taking unforgivably long (although was working) so I blamed on the server or whatnot and I decided to try an alternative.
I specified the delivery method to be a pickup directory which practically means that instead of sending anything the SMTP client would just create a local file.
_smtpClient = new SmtpClient(_smtpClientHost, _smtpClientPort);
_smtpClient.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
_smtpClient.PickupDirectoryLocation = Application.persistentDataPath;
_smtpClient.Timeout = (int)(_smtpClientTimeout * 1000.0F); // Seconds to milliseconds
_smtpClient.UseDefaultCredentials = false;
_smtpClient.Credentials = (ICredentialsByHost)new NetworkCredential(_smtpClientCredentialsUserName, _smtpClientCredentialsPassword);
_smtpClient.EnableSsl = _smtpClientEnableSsl;
ServicePointManager.ServerCertificateValidationCallback =
(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) => { return true; };
I made sure nothing stands on the way and simply put the iPad to Flight Mode. To my surprise it still took about 30 (THIRTY) minutes to simply create a 10mb heavy .eml file locally.
Have you experienced anything similar and would you have a solution to this? Or is this the nature of SMTP and I should just say goodbye to it?
PS: Just sending the same 10mb .mov file with the native Mail client takes seconds.
Your answer
Follow this Question
Related Questions
How to access parameter of a method (declared in the method itself) from another method? 1 Answer
SmtpClient gmail An existing connection was forcibly closed by the remote host. 2 Answers
Movie texture lagging 1 Answer
Slow prefab loading issue 1 Answer
Unity Editor very slow using graphics processor Nvidia GeForce GTX 1060 1 Answer