Inadequate dictionary listing for mobileComposeEmail
Posted: Sat Feb 22, 2014 1:53 am
I've tried a million variations of code to send an e-mail with an image file as an attachment and cannot get it to work on Android.
The dictionary listing for mobileComposeMail is not much use because
1) it gives no example of using the attachment array with a key of 'file';
2) it gives no direction on which keys of the attachment array are necessary to use - it only states that you must have one or other of 'data' or 'file', but no mention of when to use one rather than the other and no mention at all of the keys 'type' or 'name' - these just mysteriously appear in the examples. There may be other keys which could be used, but who knows?
3) it gives no definitions of the values which are valid for 'type'
Just for the lols, here are variations of code which I know don't work. In every case where an attachment is apparently saved to the email, it is 0.00 kb. Any suggestions welcome.
-- the default folder is set to the 'documents' folder
-- the image file is saved to the documents folder (as a PNG) file with the extension .png
-- the name of the image file is put into a variable, vFileNm
-- the preceding code checks for the existence of the image file (using the vFileNm variable) in the documents folder
1.
put url "binfile:" & vFileNm into tAttachment["file"]
put "image/png" into tAttachment["type"]
put "my picture" into tAttachment["name"]
mobileComposeMail "Image Example", "howard@firkin.biz",,,,tAttachment
2.
put url "file:" & vFileNm into tAttachment["file"]
put "image/png" into tAttachment["type"]
put "my picture" into tAttachment["name"]
mobileComposeMail "Image Example", "howard@firkin.biz",,,,tAttachment
3.
put url "binfile:" & vFileNm into tAttachment["data"]
put "image/png" into tAttachment["type"]
put "my picture" into tAttachment["name"]
mobileComposeMail "Image Example", "howard@firkin.biz",,,,tAttachment
4.
put url "file:" & vFileNm into tAttachment["data"]
put "image/png" into tAttachment["type"]
put "my picture" into tAttachment["name"]
mobileComposeMail "Image Example", "howard@firkin.biz",,,,tAttachment
5.
put vFileNm into tAttachment["file"]
put "image/png" into tAttachment["type"]
put "my picture" into tAttachment["name"]
mobileComposeMail "Image Example", "howard@firkin.biz",,,,tAttachment
6.
put vFileNm into tAttachment["data"]
put "image/png" into tAttachment["type"]
put "my picture" into tAttachment["name"]
mobileComposeMail "Image Example", "howard@firkin.biz",,,,tAttachment
7.
put vFileNm into tAttachment["file"]
mobileComposeMail "Image Example", "howard@firkin.biz",,,,tAttachment
The dictionary listing for mobileComposeMail is not much use because
1) it gives no example of using the attachment array with a key of 'file';
2) it gives no direction on which keys of the attachment array are necessary to use - it only states that you must have one or other of 'data' or 'file', but no mention of when to use one rather than the other and no mention at all of the keys 'type' or 'name' - these just mysteriously appear in the examples. There may be other keys which could be used, but who knows?
3) it gives no definitions of the values which are valid for 'type'
Just for the lols, here are variations of code which I know don't work. In every case where an attachment is apparently saved to the email, it is 0.00 kb. Any suggestions welcome.
-- the default folder is set to the 'documents' folder
-- the image file is saved to the documents folder (as a PNG) file with the extension .png
-- the name of the image file is put into a variable, vFileNm
-- the preceding code checks for the existence of the image file (using the vFileNm variable) in the documents folder
1.
put url "binfile:" & vFileNm into tAttachment["file"]
put "image/png" into tAttachment["type"]
put "my picture" into tAttachment["name"]
mobileComposeMail "Image Example", "howard@firkin.biz",,,,tAttachment
2.
put url "file:" & vFileNm into tAttachment["file"]
put "image/png" into tAttachment["type"]
put "my picture" into tAttachment["name"]
mobileComposeMail "Image Example", "howard@firkin.biz",,,,tAttachment
3.
put url "binfile:" & vFileNm into tAttachment["data"]
put "image/png" into tAttachment["type"]
put "my picture" into tAttachment["name"]
mobileComposeMail "Image Example", "howard@firkin.biz",,,,tAttachment
4.
put url "file:" & vFileNm into tAttachment["data"]
put "image/png" into tAttachment["type"]
put "my picture" into tAttachment["name"]
mobileComposeMail "Image Example", "howard@firkin.biz",,,,tAttachment
5.
put vFileNm into tAttachment["file"]
put "image/png" into tAttachment["type"]
put "my picture" into tAttachment["name"]
mobileComposeMail "Image Example", "howard@firkin.biz",,,,tAttachment
6.
put vFileNm into tAttachment["data"]
put "image/png" into tAttachment["type"]
put "my picture" into tAttachment["name"]
mobileComposeMail "Image Example", "howard@firkin.biz",,,,tAttachment
7.
put vFileNm into tAttachment["file"]
mobileComposeMail "Image Example", "howard@firkin.biz",,,,tAttachment