Send email from app

How can I send an email from Defold application?
In Android native apps I have used Intent:

Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType(“plain/text”);
intent.putExtra(Intent.EXTRA_EMAIL, new String { “some@email.address” });
intent.putExtra(Intent.EXTRA_SUBJECT, “subject”);
intent.putExtra(Intent.EXTRA_TEXT, “mail body”);
startActivity(Intent.createChooser(intent, “”));

Are there any examples maybe?

No examples that I know of, but we do include luasocket. It should be possible to get the SMTP module up and running and use that.

I was able to get a simple request working on device using this Lua snippet (using the mailto: URL scheme):

sys.open_url("mailto:test@test.com?subject=Hello")

Maybe it solves your problem, but if you need to actually send emails from inside your app a more sophisticated solution is needed. :slight_smile:

6 Likes

We have been trying to install editor and it says to contact costomer support

How does this relate to the topic of “Send email from app”?

Can you please post a screenshot and some information about the system you’re trying to install Defold on?