1

I a trying to send an email with codeigniter. here is the content of email.php config file.

<?php

$config=
    array(
        'protocol'=>'smtp',
        'useragent'=>'Camerbitcoin',
        'smtp_host'=>'smtp.gmail.com',
        'smtp_user'=>'myemail@gmail.com',
        'smtp_pass'=>'my password',
        'smtp_port'=>'587',
        'mailtype'=>'html',

    );

and here the code that send the email.

$this->email->from('myemail@gmail.com','Compagny name');
                    $this->email->to('receiver@yahoo.fr');
                    $this->email->subject('Activation link');
                    $this->email->message('Welcome .<br/>');
                    $this->load->view('registration_success');
$this->email->send();

no errors are displayed, but the mail is not sent.

the smart life
  • 305
  • 8
  • 26

1 Answers1

0

Try it,

'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
Mert Simsek
  • 1,550
  • 9
  • 19
  • so, have you a error output? If you need debug, you try this, $mail->SMTPDebug = 1; – Mert Simsek Nov 03 '17 at 06:57
  • with this, i have another error : **bold** Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.**bold** – the smart life Nov 03 '17 at 06:59