Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How To Detect Email Size Issues In .NET

Tags:

c#

.net

email

We have an application which sends out automatic email notifications to our users.

Those emails come from a no reply address for instance '[email protected]'.

The problem comes when the attachments added to the automatic emails go above the limit of the receiver email server, e.g. 8 MB, or 10 MB.

Is there a way in .NET to detect that this is going to happen? If a reply comes to no-reply saying that there is a failure because the limit was exceeded that is not ideal because that address is never checked.

Is there a way of detecting whether this will be a problem before sending the email?

I guess the main problem is that the email size limit can be configured, so we don't know what it is going to be for a particular organisation.

like image 789
peter Avatar asked Oct 03 '11 03:10

peter


1 Answers

Just a thought, why don't you insert links to the attachments/files instead? I've been though this several times, and yes if the file to attach is personal, attach it, otherwise just put the attachment on a webserver and link to it.

That would certainly speed up mail delivery, and reduce bouncing messages.

Hope this helps!

like image 77
Fredrik Johansson Avatar answered Sep 25 '22 18:09

Fredrik Johansson