Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29959

In plesk server Codeigniter Mail Function not working with gmail on server side but good in localhost?

$
0
0

Everything going great on Codeigniter localhost but on particuler Plesk Linux Server I get the different type of error as per changing the port number and protocols. I'm really hanging on this problem, also read the documentation of Plesk but I didn't understand. Hope on StackOverflow someone gives a solution.

I tried most of the all port and protocols to get the result but not succeded. Used code

function sendMail()
{
  $this->load->library('email');
  // ini_set('SMTP', "smtp.rediffmailpro.com");
  // ini_set('smtp_port', "25");
  // ini_set('sendmail_from', "myemailid");
  // curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
  // curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    $config = array(
      // for rediff mail setup
      // 'protocol' => 'smtp',
      // 'smtp_host' => 'smtp.rediffmailpro.com',
      // 'smtp_port' => 587,
      // 'smtp_user' => 'email.com',
      // 'smtp_pass' => 'pass',
      // 'mailtype' => 'html',
      // 'charset' => 'iso-8859-1', //'UTF-8'
      // 'wordwrap' => TRUE

      // for gmail setup
      'protocol' => 'smtp', //'mail', 'sendmail', 'tls' tried these but get different type of errors
      'smtp_host' => 'smtp.gmail.com', /*'smtp.googlemail.com',*/
      'smtp_port' => 587, //465
      'smtp_user' => 'user email',
      'smtp_pass' => 'user pass',
      //'smtp_crypto' => 'smtp',
      'mailtype' => 'html',
      'smtp_timeout' => 5,
      'charset' => 'utf-8',
      'wordwrap' => TRUE
    );
    $this->email->initialize($config);
    $this->load->library('email', $config);
    $this->email->from('email','AG'); // change it to yours 
    $this->email->to('your email');// change it to yours
    $this->email->subject('Test Mail');
    $this->email->message('Dont be pannic.');  
      $this->email->set_newline("\r\n");
      if($this->email->send())
       {
        echo 'Email sent.';
       }
     else
      {
       show_error($this->email->print_debugger());
      }
}

At this condition I get this error

Failed to authenticate password. Error: 534-5.7.14 Please log 534-5.7.14 in via your web browser and then try again. 534-5.7.14 Learn more at 534 5.7.14 https://support.google.com/mail/answer/78754 k11sm2916535wmk.45 - gsmtp Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.

But on given google url didn't get any idea about my problem or I didn't get it.

After changing

port 465,
smtp_hot "ssl://email.com",

Get this error

Failed to authenticate password. Error: 534-5.7.14 Please log 534-5.7.14 in via your web browser and then try again. 534-5.7.14 Learn more at 534 5.7.14 https://support.google.com/mail/answer/78754 y66sm2047426wmd.37 - gsmtp Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method. I don't understand what am I doing wrong.

Want to successfully send mail. On Plesk server


Viewing all articles
Browse latest Browse all 29959

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>