views:

302

answers:

4

Hi,

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

+2  A: 

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.

Matthew Scharley
Exception : The type or namespace name 'Test' could not be found (are you missing a using directive or an assembly reference?and same for "TestFixture" namespace
Preeti Singh
Do i need to add any API?
Preeti Singh
@Preeti: I havn't used #ziplib before with any real level of success, so I'm probably the wrong person to ask about how to work with it. Sorry.
Matthew Scharley
A: 

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.

JBRWilkinson
A: 

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?

DarkBobG
A: 

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.

Cheers!
Dave

dave wanta
I made changes in my Post.
Preeti Singh