Send simple email action allows sending an email from one email address to another.
You can edit several parameters: the text and the subject of the message, the sender and recipient email addresses. You can also attach files of any format supported by your email service provider.
This action is available at any event except JavaScript onload events.
Note: To use this action, you have to set up the Email settings. Press this button on the toolbar or write the code manually.
// ********** Send simple email ************
$email="test@test.com";
$from="admin@test.com";
$msg="Hello there\nBest regards";
$subject="Sample subject";
$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $msg, 'from'=>$from));
if(!$ret["mailed"])
echo $ret["message"];
You can send HTML emails as well:
Note: Assign HTML code to your $msg variable and replace the 'body' key with 'htmlbody' key.
// ********** Send HTML email ************
$email="test@test.com";
$from="admin@test.com";
$msg="<b>Hello there</b><br>Best regards";
$subject="Sample subject";
$attachments = array();
$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'htmlbody' => $msg, 'from'=>$from, 'attachments' => $attachments));
To learn how to customize email templates, see Registration and passwords: Email templates.
See also:
•Send an email with attachment
•Send an email to selected users
•How to email selected records as separate PDF files
•A complete guide to sending emails with a web based application