Page 1 of 1

The right way to email a video

Posted: Wed Jun 19, 2013 12:34 am
by Mag
Hi,

which is the best way to send a video via email? I'm trying this but the video file is not attached to the composed email...

mobileComposeMail "My subject", , , , "My body", videoPath

Re: The right way to email a video

Posted: Wed Jun 19, 2013 9:36 am
by Mark
Hi,

There are (at least) two ways to send an attachment. The first is to attach the binary data directly.

Code: Select all

put url ("binfile:" & myVideoPath) into myData["data"]
put "video/mp4" into myData["type"]
put "File Name" into myData["name"]
mobileComposeMail "My subject", , , , "My body", myData
The second way is to provide a file path.

Code: Select all

put myVideoPath into myData["file"]
put "video/mp4" into myData["type"]
put "File Name" into myData["name"]
mobileComposeMail "My subject", , , , "My body", myData
In both cases, the attachment parameter needs to be an array.

The mobileComposeMail entry in the dictionary contains some very good examples and is worth reading.

Kind regards,

Mark

Re: The right way to email a video

Posted: Thu Jun 20, 2013 4:43 pm
by Mag
Thank you so much Mark, this make all clear.

Re: The right way to email a video

Posted: Sat Jan 18, 2014 9:52 pm
by Mag
Is the first way adapt also to send images? I mean, could I send an image without have a file?

Re: The right way to email a video

Posted: Sat Jan 18, 2014 10:23 pm
by Mark
Hi,

Yes, that should work.

I don't know if this is relevant to you, but this won't work on Android due to a bug. It works on iOS only.

Kind regards,

Mark

Re: The right way to email a video

Posted: Sat Jan 18, 2014 10:30 pm
by Mag
Mark wrote:Hi,

Yes, that should work.

I don't know if this is relevant to you, but this won't work on Android due to a bug. It works on iOS only.

Kind regards,

Mark

Oh, yes, it's very relevant, it was just because I could not send attachments with Android I wanted to know this method. So now I know that there is no hope. Thanks for telling me.

PS
Just to understand, to send an image, what I should write instead of

put url ("BinFile:" & myVideoPath) into myData ["date"]?

Re: The right way to email a video

Posted: Sat Jan 18, 2014 11:00 pm
by Mark
Hi,

If you want to send an image that is on the card, you can use

Code: Select all

put the text of img 1 into myData["data"]
and if you want to send an image that is on disk, you can use a file path in the same way as with videos. Keep in mind that the mime type is different. For PNG files for example:

Code: Select all

put url ("binfile:" & myPicturePath) into myData["data"]
put "image/png" into myData["type"]
put "File Name" into myData["name"]
mobileComposeMail "My subject", , , , "My body", myData
If you want to include an image from the stack rather than from a file and you don't know which format the image is in, you can export it first:

Code: Select all

export snapshot from img 1 to myPictureData as PNG
put myPictureData into myData["data"]
put empty into myPictureData
put "image/png" into myData["type"]
put "File Name" into myData["name"]
mobileComposeMail "My subject", , , , "My body", myData
Kind regards,

Mark

Re: The right way to email a video

Posted: Sun Jan 19, 2014 1:55 am
by Mag
Thank you so much Mark!