Hi Joshua,
I had a chance to test the fix in build #978 on an Nook Color and iPad today. While sending email with attachments technically works, there are still a couples problems that make it not quite fully functional.
As background, in my app the user can use images they’ve previously saved in a folder in their documents directory as multiple image attachments in an email. I followed the advice in the tutorial here to create a table used to construct an email message with attachments: http://www.coronalabs.com/blog/2012/01/03/composing-email-and-sms-in-corona/
The code looks something like
[lua] local attachmentTable = {}
for i = 1, #photosTable do
attachmentTable[i] = {baseDir=system.DocumentsDirectory, filename= “BGPhotos/”…photosStuffTable[i].name, type=“image”}
end
local options =
{
–to = “john.doe@somewhere.com”,
–subject = CurrentEntryTable.timedate,
body = DataController.getCurrentText(),
attachment = attachmentTable,
}
native.showPopup(“mail”, options) [/lua]
On the iPad, everything works great. Multiple images can be imported into the native email composition tool. When I send the message it appears (In thunderbird) with either the images in line within the text body if there’s only one image, or as a list of attached images that can be saved if there’s more than one image attached.
On the Nook Color, though, if there is only one image attached is comes through as a garbled mash of text characters in line with the body text. It is “technically” working because the attachment can still be saved from the email program and it can indeed be loaded correctly into an image editing program, but within the email itself it looks like a whole bunch of garbage text. Even worse, if I attach more than one image to the email, the email is sent without any attachments, garbage or otherwise. Both platforms are using the same code.
When I examined the source of the email messages sent from the iPad and Nook I saw some notable differences.
On iPad (working correctly):
[text]
–Boundary_(ID_+qh4r7XE2uK9TF9RQGCd2A)
Content-type: image/jpg; name=“BGphoto 1354998101.jpg”
Content-transfer-encoding: base64
Content-disposition: inline; filename=“BGphoto 1354998101.jpg”
/9j/4AAQSkZJRgABAQAAAQABAAD/4QBYRXhpZgAATU0AKgAAAAgAAgESAAMAAAABAAEAAIdpAAQA
AAABAAAAJgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAACIqADAAQAAAABAAABmgAAAAD/2wBD
AAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB…
[/text]
And on Nook (email program displays images as a long string of ascii):
[text]
Content-Type: ;
name=“BGphoto 1355009495.jpg”
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename=“BGphoto 1355009495.jpg”;
size=20830
/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkz
ODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2Nj
Y2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wAARCAHgAYoDASIA…
[/text]
The obvious difference to me is the email formed on the iPad shows “Content-type: image/jpg;” while the email formed on the Nook shows a blank content type “Content-Type: ;” From the code above you can see I’m setting the content type to “image” when I create the email, and it’s the identical code running on both platforms. So thunderbird isn’t able to guess correctly about the attachment being an image, but the Nook isn’t setting the image type correctly to begin with.
I’m not sure what would explain multiple attachments failing completely on Nook, but given that the identical code works fine on the iPad I’m guessing it’s something I can’t fix on my end and can only be addressed by Coronalabs.
Let me know if there’s any more info. I can provide towards a solution to these issues. And thanks again for taking a look.
-Stephen [import]uid: 9422 topic_id: 19798 reply_id: 134350[/import]