Ok so I spent a short time making this survey, and setting up a form to handle sending invites for the survey out to people (to be used in house). During production it was working fine, now the emails are not showing up in our in-boxes. The mail function is still returning true, so I’m unsure of why its not showing up. None of the code has changed, and our development environment is on the exact same server as our production environment, so ini settings are all the same as well. Below is a snippet of the code, and attached is the entire file.
[code=php]
// Constant email settings.
$sub = ‘— Satisfaction Survey Invite’;
$headers = ‘MIME-Version: 1.0’. PHP_EOL;
$headers .= ‘Content-type: text/html; charset=iso-8859-1’. PHP_EOL;
$headers .= ‘FROM: —@—.com’. PHP_EOL;
// Base SQL for multiple insert
$sql = ‘INSERT INTO survey_invites (id_invite,invite_email,invite_token) VALUES ‘;
foreach( $emails as $info ) {
$token = saltyhash($info[’email’]);
// Send mail message to each recipient
$to = $info[’email’];
$msg = buildmsg($info[‘name’],$token,$info[‘type’]);
if( mail($to,$sub,$msg,$headers) )
$content .= ‘Message to ‘. $info[‘name’] .’ sent successfully.<br />’;
else
$content .= ‘Message to ‘. $info[‘name’] .’ failed to send.<br />’;
// Build SQL to insert email/token for validation later.
$sql .= ‘(NULL,”. $info[’email’] .”,”. $token .”),’;
}
$sql = substr($sql,0,-1);
if( $db->query($sql) )
$content .= ‘Emails and tokens successfully stored in the database.’;
As I said, it was working perfectly while I was testing it, now its like the emails aren’t sending, or for some reason just aren’t making it to our inbox (yes we’ve checked our spam box as well)
*Note: I have removed identifying information.
[upl-file uuid=df931553-44d5-413b-b8f9-f3c51d619637 size=5kB]temp.txt