mobileComposeHTMLMail

Randy Hengst iowahengst at mac.com
Sat Nov 28 09:27:59 EST 2015


Hi All,

I’m messing with mobileComposeHTMLMail iOS for the first time. I’ve read the dictionary entry and reviewed mail archives and have been able to get everything working except including an attachment. 

My goal is to place a screen shot into the body of an email message. The code below works for everything but the attachment. I do see a question mark in the body of an email where I assume the screen shot should appear. What am I overlooking?

I’m using LC 7.1 Indy, Mac 10.10.5, Xcode 6.4

on mouseUp
   local tSubject, tToAddress, tCC, tBCC, tBodyAsHTML, tAttachments
   
   if the environment is "Mobile" and mobileCanSendMail () is false then
      answer "This device does not support e-mail" with "Okay"
   end if
   
   put field "Project" & ":" && field "Task" into tSubject
   put field "address" into tToAddress
   put empty into tCC
   put empty into tBCC

   --- make the message
   put return & "Start" && field "startTime" into tBodyAsHTML
   put return & "End" && field "endTime" after tBodyAsHTML
   put return & field "Message" & return & field "ElapsedTime" after tBodyAsHTML
   
   --- create the attachment screen shot
   set the defaultFolder to specialFolderPath("Documents")
   export snapshot from rect (the rect of button "playingSurfaceBUTTON" of card "gameCard") to file "SENDdemo.jpg" as JPEG
     
   put defaultFolder into tAttachments[1]["file"]
   put "application/jpg" into tAttachments[1]["type"]
   put "SENDdemo.jpg" into tAttachments[1]["name"]
   
   mobileComposeHTMLMail tSubject, tToAddress, tCC, tBCC, tBodyAsHTML, tAttachments
end mouseUp

be well,
randy

Randy Hengst
www.classroomFocusedSoftware.com <http://www.classroomfocusedsoftware.com/>




More information about the use-livecode mailing list