Home « Server software «
Documentation: shared/mailer.php
class Mailer - The library to send electronic messages
This script is a reference file of this system.
Licence: GNU Lesser General Public License
Auteurs:
- Bernard Paques bernard.paques@bigfoot.com
notify() - Send an email message
function notify($to, $subject, $message)
- $to - string recipient address
- $subject - string subject
- $message - string actual message
- returns an error message, if any
First of all, e-mail services have to be explicitly activated in the main configuration panel, at control/configure.php.
Second, this function is able to authenticate to the mail server using POP3 before engaging SMTP. This is the standard method used at ovh to avoid spam.
Third, long lines of the message are wrapped according to Dan's suggestion.
Messages are sent using utf-8, and are base64-encoded.
Voir aussi:
- Dan's Mail Format Site: Body: Line Length
- Advanced email in PHP
- agents/logger.php
- agents/messages.php
- control/configure.php
- query.php
- users/users.php
post() - Send an email message
function post($from, $to, $subject, $message, $headers='', $debug='shared/mailer.php')
- $from - string sender address
- $to - string or array recipient address(es)
- $subject - string subject
- $message - string actual message
- $headers='' - string or array additional headers, if any
- $debug='shared/mailer.php' - string the originating script, if any
- returns the number of actual posts, or 0
This function supports automated posts of e-mail message.
First of all, e-mail services have to be explicitly activated in the main configuration panel, at control/configure.php.
Second, this function is able to authenticate to the mail server using POP3 before engaging SMTP. This is the standard method used at ovh to avoid spam.
Third, long lines of the message are wrapped according to Dan's suggestion.
Messages are sent using utf-8, and are base64-encoded.
For bulk posts, transmit an array of strings instead of a string to list recipients.
This function returns the number of successful posts, and adds one line to $context['error'] for each error encountered.
Voir aussi:
- Dan's Mail Format Site: Body: Line Length
- Advanced email in PHP
- articles/mail.php
- letters/new.php
- users/mail.php
Reste à faire:
- allow for multipart messages