iOS Grab Image from Library and Email as Attachment?

John Patten johnpatten at mac.com
Tue Feb 14 00:23:00 EST 2012


Hi All..

I'm attempting to send an email message with an attachment of the last image added to the card via the mobilePickPhoto call. I don't have the attachment call correct.  I'm using the following:

on mouseUp
   
   if iphoneCanSendMail () is true then
      put the text of field "subject" into tSubject
      put the text of field "toField" into tTo
      put the text of fld "body" into tBody
      put "" into tCCs
      put "" into tBCCs
      
-- I'm using the mobilePickPhoto to add an image to the card from the library.
     
  put the name of the last img into gvAttachment["name"]
      put "image/jpeg" into gvAttachment["type"]
      put the text of  last img into gvAttachment["data"]
      
      mobileComposeMail field "subject", field "toField", , , field "body", gvAttachment
      answer the result with "OK"
   else
      answer "Your device cannot be used to send email." with "OK"
   end if
   
end mouseUp

Any advice on how to add the image attachment?

Thank you!

John Patten
SUSD




More information about the use-livecode mailing list