0

I have an application in a server that send emails, the email works in localhost but is weird that in the server only works in the mornings and then the emails are not sending in the afternoons, this is my email.php

$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['smtp_host'] = "smtp.exchangeadministrado.com";
$config['smtp_user'] = "MyMail.com";
$config['smtp_pass'] = "MyPass";
$config['smtp_port'] = "587";
$config['smtp_timeout'] = "30";
$config['smtp_keepalive'] = TRUE;
$config['smtp_crypto'] = "tls";
$config['charset'] = "utf-8";
$config['mailtype'] = "html";
$config['crlf'] = "\r\n";
$config['newline'] = "\r\n"; 

This is the email part of the Controller:

$htmlContent = $this->load->view('emailExpo_view',$data,true);
$this->email->set_crlf( "\r\n" );
$this->email->to(implode(', ', array($correoCliente1, $correoCliente2, $correoCliente3)));
$this->email->from('status.embarques@autotransportecari.com');
$this->email->cc($adresses);
$this->email->subject('Actualización de Exportación');
$this->email->attach(FCPATH . "imagenes/cari.png", "inline");
$this->email->message($htmlContent);
$this->email->send(); 

I Know that this is very weird because the email works only in a range of hours and then stop working. I don´t have any other configuration, the app works fine in the mornings but then the emails are not sent but when I print the email debbuger I have this mesage: "Your message has been successfully sent using the following protocol: sendmail" but actually is not sent. Do you have any aidea whyI have this issue?

  • 3
    Something is going wrong after PHP hands the email over to the SMTP server. PHP does not trace whether or not an email made it to someone's Inbox. PHP **only** knows that "email was successfully handed off to SMTP server xyz so I can call it a success". You need to check your email server logs to see why it is failing. – MonkeyZeus May 15 '18 at 17:49
  • Nothing that can be inferred from the code. CI mail pretty much uses PHPs mail function. You'll have to consult your SMTP provider, if transmissions get qualified as correo basura. – mario May 15 '18 at 17:57

0 Answers0