Open main menu

Changes

431 bytes added ,  10:47, 15 December 2016
adds mail test script
=== My wiki won't send email ===
First, did you check if mail is working from PHP?
 
<source lang="php">
<?php
$mailto = 'greg@eQuality-Tech.com';
$subject = 'test mail';
$message = 'sample message';
$from = 'wiki@example.org';
$header = "From:$from";
 
if ( mail ( $mailto, $subject, $message, $header ) ) {
echo "Email sent\n";
echo "Try 'sudo tail /var/log/mail.log' to look for other possible errors.\n";
}
</source>
 
If your application already has email capability, but it won't send, then turn on the mail_log feature in php.ini and check that sendmail/postfix is installed on your system. You might start with <code>sudo apt-get install mailutils</code>. If on AWS or datacenter, you can set up as an internet site and be done. If you are behind a consumer broadband IP, you will probably need to setup a 'smarthosted' site and use (your own) IMAP credentials to send email through another provider.
4,558

edits