We are trying to send a message with a single PDF attachment but it always fails. This is not happening with other PDF attachments.
The size of the attachment is:
1,906,061 bytes
We have increased send timeout to 900 seconds:
smtp.SendTimeout = new TimeSpan(0, 0, 900);
The MimeData.ContentType used for the attachment is "application/pdf" - as we use byte array and not file we have to set the Content Type manually using ContentType.Parse("application/pdf").
The error we get is:
Limilabs.Client.ServerException: Tried to read a line. Only '' received. Please make sure that antivirus and firewall software are disabled or configured correctly. ---> System.Exception: Tried to read a line. Only '' received. ---> System.IO.IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
We have tried 2 different SMTP Servers and problem persists.
Can you help us with this please?
Regards,
Manolis