开发者

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:

开发者_Python百科
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


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.


If you're trying to send, e.g. a 2MB WMV file and your mail gateway only allows ~500kb attachments, this just isn't going to work. You can't arbitrarily split a WMV file - the email recipient would need the same software to 'join' the pieces back up.

There are archive utilities such as WinRAR that allow you to created archives split into configurable sized chunks. Then you could either send lots of attachments in one email, or lots of emails with single attachments.

An easier solution would be to upload the file somewhere and put a link in the email to download the file later. This could be your own HTTP or FTP server, or there is an abundance of 3rd party services out there that let you do just this, YouSendIt seems popular.


I know this isn't exactly an answer, but in my testing, I was able to send attachments up to 3MB in size without a problem. Are you sure you're not running into a limitation imposed by your smtp host on outbound attachment sizes?


Before everyone goes on a wild goose chase, can the original poster actually post the exception text they are seeing?

This could be anything from the web server timing out, to the mail server not accepting large attachments, to not having proper permissions.

Without seeing the exception text, and stack trace, these vauge questions can be a exercise in futility.

Not trying to be rude or anything, but the more information provided with a question, the easier it is to answer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜