Welcome Guest, Not a member yet? Register   Sign In
Email class with Exchange ending up in SPAM folder
#1

[eluser]DanielJay[/eluser]
I am working on trying to solve an issue with my code for sending out emails via Codeigniter. We have an Exchange server for email and use IIS for our web server. Whenever I send out an email with the code the email is sent to the SPAM folder of Outlook (2010). Here is a bit of code from my testing.

I have attempted to set the config through the config/email.php file. I have also attempted to set the smtp_user and smtp_pass with no luck.

Code:
<?php
$config = Array(
   'protocol'  => 'smtp',
   'smtp_host' => '10.10.10.x',
   'smtp_port' => 25,
   'mailtype'  => 'html',
   'charset'   => 'iso-8859-1'
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");

$this->email->to($To);
$this->email->from('hiddenemail', 'IS Department');
$EmployeeName = $this->Usersmodel->GetUserName();
if ($_SERVER['SERVER_NAME']=='web') {
$this->email->subject('New benefit day request from '.$EmployeeName);
} else {
$this->email->subject('New benefit day request from '.$EmployeeName.' - JUST A TEST');
}
$message = "My message here";
if ($Covering === true) {
$message .= "\n\n*This email is being sent to multiple people as:\n".join("\n", $CoveringText);
}
$this->email->message($message);
if (!$this->email->send()) {
$this->data['Error'][] = 'Error sending new request email';
log_message('error', $this->email->print_debugger());
}

Any suggestions?




Theme © iAndrew 2016 - Forum software by © MyBB