All ways to send an email

Published on February 20, 2022

This site is revised and edited in October 2022. Some features are no longer working, and for those who aren't, I have added a a red note next to it. Thank you.

App Inventor is a powerful tool to build apps, so powerful that it has more than 10 ways to send an email. This guide will go through all of the ways that I found and used. I took reference from Taifun's email solutions list. Thank you!

🏷️ Tags: #tutorials-and-guides

Method #1 - ActivityStarter component

You can use the ActivityStarter component to send emails (the most popular way). However, the user will see a popup of their email written in the email app, and they have to confirm it.

Method #2 - Sharing component

The App Inventor Sharing component can help you share emails. However, the user does not only see their email apps as their choice, but they are allowed to share it with even Google Drive. It does have one extra option though - you can send a file and/or a message.

Method #3 - TaifunMail Extension from Taifun (a.k.a. Pura Vida Apps)

This is a paid extension (12 USD) from Taifun that allows you to send emails via SMTP without user interaction to several To, Cc or Bcc addresses, add several attachments and send in plain text or HTML format. Redirect to Pura Vida Apps.

Method #4 - Google Apps Script + GoogleGmail Extension from Preet

This is a free extension to send Gmails by Preet with details here. You will have to go to Google Drive, create an Apps Script project, and then deploy it. Copy the deployment key / deployment ID (do not share deployment keys with others) and paste it in the deploymentKey variable. Learn to deploy Apps Script here.

Script:

function doPost(request) {

let emailId = request.parameters.mail_Id;

let emailBody = request.parameters.body;

let emailSub = request.parameters.sub;

const output = {};

try {

GmailApp.sendEmail(emailId, emailSub, emailBody);

output['status'] = 'ok';

output['msg'] = 'mail sent successfully';

} catch (err) {

output['status'] = 'error';

output['msg'] = err;

}

return ContentService.createTextOutput(JSON.stringify(output)).setMimeType(ContentService.MimeType.JSON);

}

Method #5 - OTP Verification + Web component (Unsecure)

This is a way to send emails with OTP verification and the Web component here . However, sometimes Google flags these emails as unknown source (also the extension does not follow naming conventions, and the extension is probably not from its own owner).

1ST EDIT: I found the original link here in Kodular community.

(10/30/2022) I have just tested the method and it is no longer working, The PHP server is now down as I had expected. Please use other features. Thank you.

Method #6 - MailSender Extension from UnknownBeast (a.k.a. RudraFromIndia)

Another good extension to send Gmails, details here. Despite a variety of options available, Google might still flag the activity as "dangerous".

(10/30/2022) I have just tested the extension and it is no longer working. For some reason, Google has disabled features to allow the extension to work. You might want to try other methods. Thank you.

Method #7 - eFeMail Extension by alegoriasoft (a.k.a. eFe)

Another good extension to send mails, the situation is about the same as #6 above.

Method #8 - SmtpClient Extension by vknow360 (a.k.a. Sunny Gupta)

Extension that allows you to send emails via SMTP servers. For details, click here. Sample usage below from MIT App Inventor community post.

Method #9 - EmailSender SMTP extension by SaidDev (paid and unsupported)

Here is a paid extension from SaidDev that does something similar like the free SmtpClient extension. However, the post is from Thunkable Community, and it seems that the user is not active there anymore.

Method #10 - TIMAI2's Google Apps Script solution

An extension-free method (except from Juan Antonio's FileToStringASD extension) that uses Google Apps Script to send emails. You will need to deploy a Google Apps Script project. More details in his website here. Thank you METRIC RAT AI2!

Google Apps Script (open to view):

function doGet(e) {

var output = '';

if (e.parameter.FN == "textFile") {

var blob = Utilities.newBlob(e.parameter.content, e.parameter.mimetype, e.parameter.filename);

MailApp.sendEmail(e.parameter.email, 'Text Attachment example', 'One file is attached.', {

name: 'Email One Attachment',

attachments: [blob]

});

output = 'Email with text attachment sent';

}

else if (e.parameter.FN == "message") {

MailApp.sendEmail(e.parameter.email, 'Message example',e.parameter.content, {

name: 'Message'

});

output = 'Email with message sent';

}

else if (e.parameter.FN = "quota") {

var emailQuotaRemaining = MailApp.getRemainingDailyQuota();

output = 'Remaining email quota: ' + emailQuotaRemaining;

}


return ContentService.createTextOutput(output);

}


function doPost(e) {

if (e.parameter.FN == "image") {

var data = Utilities.base64Decode(e.parameter.content);

var blob = Utilities.newBlob(data, e.parameter.mimetype, e.parameter.filename);

MailApp.sendEmail(e.parameter.email, 'Image Attachment example', 'One image file is attached.', {

name: 'Image',

attachments: [blob]

});

output = 'Email with image attachment sent';

}

return ContentService.createTextOutput(output);

}

Other solutions:

There are still a lot of other solutions to send emails. Click these links to learn more. Happy inventing!

πŸ’¬ Messages

βš™οΈ ✏️ EDITED 02.20.2022