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 (VB) ************
Dim email = "test@test.com"
Dim from = "admin@test.com"
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 = "test@test.com";
string from = "admin@test.com";
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:
•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