I need to send an email with attachments from an app. I had at one time built an app that had the ability to send an email with attachments and it worked just fine. Now, as of iOS 10.2.1, it doesn’t seem to work and I can’t tell if it’s because I’m writing the code wrong or if the native.showPopup is not compatible with iOS 10.2.1.
I am using Corona build 2017.3059.
Also, I have checked my device (an iPhone 6) with native.canShowPopup( “mail” ) and it indicated that the mail pop up feature is available on the device.
Below is the code I’m using.
local widget = require( "widget" ) -- Function to handle button event local function sendMail( event ) if ( "ended" == event.phase ) then if ( native.canShowPopup( "mail" ) ) then native.showAlert( "Alert!", "Mail IS available on this device", { "OK" } ) local options = { to = { "john.doe@somewhere.com", "jane.doe@somewhere.com" }, cc = { "john.smith@somewhere.com", "jane.smith@somewhere.com" }, subject = "My High Score", isBodyHtml = true, body = "\<html\>\<body\>I scored over \<b\>9000\</b\>!!! Can you do better?\</body\>\</html\>" } native.showPopup( "mail", options ) else native.showAlert( "Alert!", "Mail NOT available on this device", { "OK" } ) end end end -- Create the widget local mailButton = widget.newButton( { label = "Mail", fontSize = 64, onRelease = sendMail, -- this is my function to send mail labelColor = { default={ 1, 1, 1 } }, labelAlign = "center", emboss = false, shape = "roundedRect", width = 200, height = 100, cornerRadius = 13, fillColor = { default={1,0,0}, over={0,1,1} }, strokeColor = { default={1,1,1}, over={1,1,1} }, strokeWidth = 4 } ) mailButton.x = display.contentCenterX mailButton.y = display.contentCenterY
Please Help!!!