Skip to main content
Version: Fegg 5.x (next)

Mail::log

Append a message to the log file

Description​

public boolean Mail::log( string $message )

Appends a separator line and $message to the log file set by Mail::setDebugFlag (/tmp/sendmaillog by default). Nothing is written when the file or its directory is not writable. The return value is always true.

Mail::send calls this method with the whole message when the debug flag is enabled.

Arguments​

NameData typeDefaultRemarks
$messagestringLog message

Example​

Controller
use Fegg\Tool\Mail;

$mail = new Mail();
$mail->setDebugFlag(true, FEGG_SITE_DIR . '/data/log/mail.log');
$mail->log('Contact form posted');