Email Sending Problem

#1
[eluser]rainfall[/eluser]
I want to send mail with gmail id from CodeIgniter with gmail smtp.
But some error occurred . I just created a controller for testing purpose. When i click a link its send mail based on my configuration . Here is the mail code.. .
Code:
function __construct() {
        parent::__construct();
       // $this->load->library('email', $config);
    }


function sendMail()
{
$config = Array(
    'protocol' => 'smtp',
    'smtp_host' => 'ssl://smtp.googlemail.com',
    'smtp_port' => 465,
    'smtp_user' => '**********@gmail.com',// From
    'smtp_pass' => '*********',// password
    'mailtype'  => 'html',
    'charset'   => 'iso-8859-1'
);
//$this->load->library('email', $config);
//$this->email->set_newline("\r\n");

      $message = 'Hello';
      $this->load->library('email', $config);
      $this->email->set_newline("\r\n");
      $this->email->from('**********@gmail.com'); // From
      $this->email->to('********@gmail.com');//To
      $this->email->subject('First Mail');
      $this->email->message($message);
      if($this->email->send())
     {
      echo 'Email sent.';
     }
     else
    {
     show_error($this->email->print_debugger());
    }

    
}


I edited php.ini with
Code:
SMTP = smtp.googlemail.com
; http://php.net/smtp-port
smtp_port = 465


Code:
220 mx.google.com ESMTP v11sm6817390pas.24 - gsmtp

hello: 250-mx.google.com at your service, [103.230.104.8]
250-SIZE 35882577
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH XOAUTH2 PLAIN-CLIENTTOKEN
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
Failed to authenticate password. Error: 535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 http://support.google.com/mail/bin/answer.py?answer=14257 v11sm6817390pas.24 - gsmtp


..........................
.........................
.............................
lot of errors here ..


How can I solve this error ??

#2
[eluser]ivantcholakov[/eluser]
Just a guess, maybe authentication fails because there are two domains within your settings: googlemail.com and gmail.com.

#3
[eluser]rainfall[/eluser]
i change php.ini into .... gmail.com
and smtp_host in configuration to gmail.com ...
still error ..

#4
[eluser]InsiteFX[/eluser]
Most email servers will reject the email if the From and To are the same email address use a different one.

But from the Error it is not seeing your username or password one of them maybe wrong.

#5
[eluser]rainfall[/eluser]
It working .. it was typo in my address ...

Now one question can i use other addresses ??? like yahoo/hotmail

Then what to do for that ??


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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