Can't send mail in "Forget password" function when logging

i have 1 problem when I have executed "Forget password" function in Logging.
Message: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()

I have configured Email.php in system/libraries

var    $useragent        = "CodeIgniter";
    var    $mailpath        = "/usr/sbin/sendmail";    // Sendmail path
    var    $protocol        = "mail";    // mail/sendmail/smtp
    var    $smtp_host        = "";        // SMTP Server.  Example:
    var    $smtp_user        = "";        // SMTP Username
    var    $smtp_pass        = "********";        // SMTP Password
    var    $smtp_port        = "25";        // SMTP Port

But it has not run? Please help me

I guess you might have edited the system/libraries/Email.php
if so nothing to do with that.

first be ensure that if actually providing smtp service

why to wonder. create your gmail account if you dont have and enable the smtp service after going to setting.
then it works .gmail provides free smtp service

then inside config folder create file something like Email.php and copy paste the below code

$config['protocol']     = 'smtp';
    //$config['mailpath']     = '/usr/sbin/sendmail';
      $config['charset']      = 'iso-8859-1';
    //$config['wordwrap']     = TRUE;
    //$config['mailtype']     = 'html';
      $config['smtp_host']    = '';
      $config['smtp_user']    = 'gmail';
      $config['smtp_pass']    = 'gmail password';
      $config['smtp_port']    = 25;
      $config['smtp_timeout'] = 30;
      $config['charset']      ='utf-8';  
      $config['newline']      ="\r\n";

Then edit php.ini ====>SMTP=

Thanks for helping but it has appeared other error:
530 5.7.0 Must issue a STARTTLS command first
I have done may ways which in internet but it has not working. Please help me again.

Did you enable smtp service in gmail account??

go to setting -->Forwarding and POP/IMAP -->Enable POP for all mail (even mail that's already been downloaded)
OR Enable POP only for mail that arrives from now on

and save changes Apps/thread?tid=396e53acd0030ef4&hl=en

Thanks for helping but my problem has solved, it has not worked because my stupid fault: Not open mode ssl extension in php.ini

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.