Please enable JavaScript to view this site.

Navigation: Advanced topics > Events > Predefined actions

Events. Send simple email

Scroll Prev Next More

 

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.

send_simple_email_select_action

 

Note: To use this action, you have to set up the Email settings. Press this button hmfile_hash_34fe252e on the toolbar or write the code manually.

 

 

 

'**********  Send simple email (VB) ************
Dim email = "[email protected]"
Dim from = "[email protected]"
Dim msg = "Hello there. Best regards"
Dim subject = "Sample subject"
Dim attachments = XVar.Array()
Dim ret as XVar
ret = MVCFunctions.runner_mail(New XVar("to", email, "subject", subject, "body", msg, "from", from, "attachments", attachments))
if Not CType(ret("mailed"), Boolean) Then
   MVCFunctions.Echo(ret("message"))
End If

 

// **********  Send simple email (C#)  ************
string email = "[email protected]";
string from = "[email protected]";
string msg = "Hello there\nBest regards";
string subject = "Sample subject";
XVar attachments = XVar.Array();
 
XVar result;
result = MVCFunctions.runner_mail(new XVar("to", email, "subject", subject, "body", msg, "from", from, "attachments", attachments));
 
if(!result["mailed"])
{
  MVCFunctions.Echo(result["message"]);
}

 

To learn how to customize email templates, see Registration and passwords: Email templates.

See also:

runner_mail function

Send mass email to all users

Send an email to selected users

Send email with new data

Send email with old data

Email selected records

How to email selected records as separate PDF files

A complete guide to sending emails with a web based application