Name

doEmail — sends email to a user

Synopsis

doEmail($address, $subject, $content);
doEmail($address, $subject, $content, $code);
doEmail($address, $subject, $content, $code, $precedence);
doEmail($address, $subject, $content, undef, $precedence);

doEmail sends a message to a user. Normally, this is an email. The first three parameters are required and are treated as the destination address, mail subject, and content of the email message. This is exported from Slash::Utility::System. The optional $precedence parameter can be used to set the precedence of the message. This is a widely supported but unstandard option for mail servers. The only available option is bulk.

This function integrates tightly to the standard messaging plugin. If it is installed, the $code parameter can be used to distinguish between messages that should be sent as email and those that should be sent through the web interface. The available options are taken from the code_param table of the deliverymodes type. The value 0 sends an email, while 1 sends a web message. The available values may change in future versions, so it may be wiser to choose these from the database.

Example

use Slash::Utility;

my $mode = $slashdb->sqlSelect('code', 'code_param', 'name=E-mail');
doEmail('hemos@slashdot.org', 'finished!', <<MESSAGE, $mode);
Hi Jeff,

I've finished the book.  Tell Bella hello from Uncle chromatic!
-- c

MESSAGE

Get Running Weblogs with Slash now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.