email with attachment

How would i do a

local eoptions = 

{

to="", 

from="", 

subject=_G.lg_mdtempchart, 

body=_G.lg_mdchartbody, 

isBodyHtml=false,

attachment={baseDir=system.DocumentsDirectory, filename=“tempchart.jpg”, type=“image”}

}

native.showPopup(“mail”, eoptions)

that works fine on iOS/Android  within OSX??

thanks

chris

native.showPopup() is only supported on Android and iOS.

For OS X and Win32 desktop apps, your only option to show a draft e-mail window is via system.openURL() with a “mailto:” URL scheme, like how websites do it.  This will launch the default mail client on the desktop.  Just note that a mailto: URL does not support attachments.

hmmm, thx joshua

so how could i do now an email with attachment with corona and osx??

On Windows, there is no standard native API for this.  Because there is no standard mail app or native API for other mail app developers to adhere to.  Users are free to use any desktop mail app that they want on Windows.  So, there is no dependable means of creating an e-mail draft with a mail attachment unless you go well out of your way to write native code that explicitly supports common mail apps such Outlook, Thunderbird, etc. that do have open APIs (and again, there is no standard)… and which in my opinion isn’t really worth it.  Nobody really does this on Windows and just does a mailto URL scheme instead.  So, I think you’re going to have to redesign your app to work with this desktop limitation.

On OS X you might want to take a look at this Apple document About Apple URL Schemes which talks about URL schemes the OS uses but this is a very platform specific solution.

So on OS X the code would be:

system.openURL('mailto:corona@example.com?cc=bar@example.com&subject=Greetings%20from%20Palo%20Alto!&body=Corona%20SDK%20rules!')

native.showPopup() is only supported on Android and iOS.

For OS X and Win32 desktop apps, your only option to show a draft e-mail window is via system.openURL() with a “mailto:” URL scheme, like how websites do it.  This will launch the default mail client on the desktop.  Just note that a mailto: URL does not support attachments.

hmmm, thx joshua

so how could i do now an email with attachment with corona and osx??

On Windows, there is no standard native API for this.  Because there is no standard mail app or native API for other mail app developers to adhere to.  Users are free to use any desktop mail app that they want on Windows.  So, there is no dependable means of creating an e-mail draft with a mail attachment unless you go well out of your way to write native code that explicitly supports common mail apps such Outlook, Thunderbird, etc. that do have open APIs (and again, there is no standard)… and which in my opinion isn’t really worth it.  Nobody really does this on Windows and just does a mailto URL scheme instead.  So, I think you’re going to have to redesign your app to work with this desktop limitation.

On OS X you might want to take a look at this Apple document About Apple URL Schemes which talks about URL schemes the OS uses but this is a very platform specific solution.

So on OS X the code would be:

system.openURL('mailto:corona@example.com?cc=bar@example.com&subject=Greetings%20from%20Palo%20Alto!&body=Corona%20SDK%20rules!')