So on my Ubuntu Server, I use the ssmtp package to handle sending emails on my server. As of recently, emails have not been getting sent. Before posting this topic, I checked my logs and configuration files, and ran ssmtp from the command line, with success. The command that worked was:
Code:
However, my PHP script does not send email. This is except of code involving sending mail.
Code:
It is worth note that the "Success!!" never gets displayed. I have also tried $headers with AND without a newline character "\r\n".
After running this code, I checked my system logs and found the following entry involving this email:
Code:
This script is currently owned by acagliano:acagliano. I have also changed it to www-data:rockin (of which acagliano is a member of), and the same error gets printed.
Below I will post the contents of relevant configuration files.
/etc/ssmtp/ssmtp.conf
Code:
/etc/ssmtp/revaliases
Code:
**Another thing of note... this configuration has worked in the past. Why it is not now I'm not sure about.***
Code:
sstmp -v bluiitalian09@aol.com
]To: bluiitalian09@aol.com
]From: bluiitalian09@aol.com
]Testing!!!
]
]
However, my PHP script does not send email. This is except of code involving sending mail.
Code:
$headers = "From: bluiitalian09@aol.com";
$subject = "TribalWars Assessment";
$message = "Player Name: " . $_POST['player'] . "\r\n";
$message .= "Leadership: " . $answers[0] . " / " . $max[0] . "\r\n";
$message .= "Teamwork: " . $answers[1] . " / " . $max[1] . "\r\n";
$message .= "Loyalty: " . $answers[2] . " / " . $max[2] . "\r\n";
$message .= "Tactics: " . $answers[3] . " / " . $max[3] . "\r\n";
$message .= "Aggression: " . $answers[4] . " / " . $max[4] . "\r\n";
$message .= "Diplomacy: " . $answers[5] . " / " . $max[5] . "\r\n";
error_reporting(E_ALL);
ini_set('display_errors', '1');
if (mail("bluiitalian09@aol.com", $subject, $message, $headers)) { echo "Success!!"; }
}
It is worth note that the "Success!!" never gets displayed. I have also tried $headers with AND without a newline character "\r\n".
After running this code, I checked my system logs and found the following entry involving this email:
Code:
/var/log/mail.err :Oct 5 10:17:03 ac-ubuntu sSMTP[20318]: RCPT TO:<bluiitalian09@aol.com> (553 5.7.1 <root@aol.com>: Sender address rejected: not owned by user bluiitalian09@aol.com)
This script is currently owned by acagliano:acagliano. I have also changed it to www-data:rockin (of which acagliano is a member of), and the same error gets printed.
Below I will post the contents of relevant configuration files.
/etc/ssmtp/ssmtp.conf
Code:
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=bluiitalian09@aol.com
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=smtp.aol.com:587
AuthUser=bluiitalian09@aol.com
AuthPass=*******
UseTLS=YES
UseSTARTTLS=YES
# Where will the mail seem to come from?
rewriteDomain=aol.com
# The full hostname
hostname=bluiitalian09@aol.com
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES
/etc/ssmtp/revaliases
Code:
# sSMTP aliases
#
# Format: local_account:outgoing_address:mailhub
#
# Example: root:your_login@your.domain:mailhub.your.domain[:port]
# where [:port] is an optional port number that defaults to 25.
root:bluiitalian09@aol.com:smtp.aol.com:587
acagliano:bluiitalian09@aol.com:smtp.aol.com:587
**Another thing of note... this configuration has worked in the past. Why it is not now I'm not sure about.***