For an overview of different eMail solutions, see here How to send an email including attachment from within App Inventor.
The idea of the example presented here is to find a simple solution without activity starter, without need to use a php server
or App Engine part.
I played around with Google Apps Script
and this is the result.
For the example I'm using my Google Spreadsheet solution,
which uploads a record into a Google spreadsheet. I used 3 columns: name, email address and message text.
Then I just added a slightly modified script I found in the Script Gallery. Thank you toptrace7 for the script.
Everybody who submits a row into that spreadsheet will trigger automatically a message to be sent to the
recipient's email address.
function contactUsMailer(e) {
// author: toptrace7, slightly adjusted by puravidaapps.com
//
// This script e-mails the contents of a form to a given recipient
// The form must have three fields in the order of: name; e-mail address; and message
// You must change the recipient variable below to your e-mail address
try {
var recipient = "<ADD YOUR EMAIL HERE>"
var timestamp = e.values[0];
var name = e.values[1];
var email = e.values[2];
var message = e.values[3];
var body = name+' <'+email+'> sent the following message: '+message;
var bodyHTML1 = '<p>'+name+' <a href="mailto:'+email+'">'+email+'</a> sent the following message: </p>';
var bodyHTML2 = '<blockquote>'+message+'</blockquote>';
var bodyHTML3 = '<p>Sent by the Pura Vida Apps <a href="http://www.puravidaapps.com/sendmailGS.php">Send Mail example</a>.</p>';
var advancedArgs = {htmlBody:bodyHTML1+bodyHTML2+bodyHTML3 , replyTo:email};
MailApp.sendEmail(recipient, "Contact Us Form", body, advancedArgs);
} catch(e){
MailApp.sendEmail(recipient, "Error - Contact Us Form", e.message);
}
}
This work by Pura Vida Apps
is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License
with attribution (name=Pura Vida Apps and link to the source site) required.