Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send mail with large size attachment using System.Net.Mail to Google Apps?

I am trying to send mail with large size attachment upto (1MB,2MB). But sending mail fails.(Sending to Google Apps) as:

MailItemEntry[] entries = new MailItemEntry[1];
String EmlPath = "C:\\testemail.eml";                                        
String msg = File.ReadAllText(EmlPath);
entries[0] = new MailItemEntry();
entries[0].Rfc822Msg = new Rfc822MsgElement(msg);

How can i divide attachments into multi part?

Exception I am getting while migrating this EML to Google apps is: {"The request was aborted: The request was canceled."}

Question on Google Forum

like image 368
Preeti Avatar asked Nov 05 '22 13:11

Preeti


1 Answers

One solution may be to use multipart zip (or other compression format that supports a similar concept) files and send each file in a seperate email.

At the least, GZip supports multipart compression as well, though I don't think either zip or gz have really good support in .NET for multipart files.

Your best bet for either is probably #ziplib.

like image 108
Matthew Scharley Avatar answered Nov 15 '22 00:11

Matthew Scharley