views:

133

answers:

4

Hi, I tried sending an e-mail with a pdf attachment over google app engine and it worked. I then used the same code with a zip file. The recipient didnt receive the mail. When I checked the logs in Google App Engine, no errors were reported either. What could be going wrong? Can someone please tell me if it is possible to send zip files over mail as attachments using Goog app engine? If yes, can you please tell me how to do it?

+2  A: 

I suspect (in the absence of further info) that your recipient's mail server/hosting will have possibly binned the mail with the .zip for being a potential virus. Many enterprises will have particular rules for accepting/rejecting mail based on attachments, and .zip files are a popular candidate for rejection.

If you can reliably send a .pdf, and reliably fail to send a .zip (of similar size) then this is the likely issue.

Brian Agnew
This is true, but in this case I think it is being blocked on the app engine side, as zip files are not on the whitelist for attachment types.
Peter Recore
That does sound likely. Looks like your answer deserves an upvote.
Brian Agnew
Brian, if such a rejection happens, will the mail not be available in recipient's mailbox as spam? the mail was not available in the recipient's mailbox as spam..
Aadith
I think that's strongly dependent on how the enterprise choose to manage this scenario. I've known places just bin such mails due to the space constraints re. storage and the possibility that people will *still* open a possibly dangerous attachment.
Brian Agnew
+1  A: 

It is possible your Mail was filtered out on the recipient's end rather than by the App engine.

Try re-sending the mail to an address that has neither spam no virus protection, or a spam folder you can check.

Otherwise, make a size comparison (Is the zip file too large on either your, or the recipient's end?) and make sure you have a proper return address so you get informed about errors.

Pekka
pekka, the mail was sent to a gmail address...checked the spam folder..the mail wasnt there.. also size doesnt appear to be the problem..the zip file contained only the pdf file whose transmission went through earlier..also, the from address was the same gmail address..didnt receive any error
Aadith
All right! I see you got it solved above. Odd that transmission would go through without error in that case.
Pekka
+1  A: 

In addition to being filtered at the recipient side, Google's SMTP servers will reject sending certain attachments deemed as "dangerous", although I'm not sure if/how that would surface as an error in app engine. May want to try sending with an attachment you know would/should be rejected (some windows exe, for instance) as a comparison.

The contents of the zip file may also make a difference (many SMTP servers will look inside them), so try a zip file that only contains the pdf that worked as another data point.

James Manning
+5  A: 

Here is a list of mime types that are allowed as attachments according to the docs. Zip files are not on the allowed list, while pdf files are.

Peter Recore
thanks peter! that looks like the reason
Aadith
You can mark his answer as accepted using the check mark icon under the number to the left.
Pekka