1

I don't know where i am doing wrong. I am following codeIgniter user guide only. I pasting code of controller...............

function do_upload()
{
    $config['upload_path'] = 'C:\xampp\htdocs\upload\application';
    $config['allowed_types'] = 'doc|docx|pdf';
    $config['max_size'] = '10240';

    $this->load->library('upload', $config);

    if ( ! $this->upload->do_upload())
    {
        $error = array('error' => $this->upload->display_errors());

        $this->load->view('upload_form', $error);
    }
    else
    {
        $data = array('upload_data' => $this->upload->data());

        echo "Resume Successfully uploaded to database.............";
    }

    $file = $data['upload_data']['full_path'];

    $config = Array(
      'protocol' => 'smtp',
      'smtp_host' => 'ssl://smtp.googlemail.com',
      'smtp_port' => 465,
      'smtp_user' => '****************', // change it to yours
      'smtp_pass' => '******', // change it to yours
      'mailtype' => 'html',
      'charset' => 'iso-8859-1',
      'wordwrap' => TRUE
    );

      $this->load->library('email', $config);
      $this->email->set_newline("\r\n");
      $this->email->from('*************'); // change it to yours
      $this->email->to('***************'); // change it to yours
      $this->email->subject('Email using Gmail.');
      $this->email->message('Working fine ! !');

      if($this->email->send())
     {
      echo 'Email sent.';
     }
     else
    {
     show_error($this->email->print_debugger());
    }
}

The following SMTP error was encountered: 185667876 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? Unable to send data: AUTH LOGIN Failed to send AUTH LOGIN command. Error: Unable to send data: MAIL FROM:

from: The following SMTP error was encountered: Unable to send data: RCPT TO:

to: The following SMTP error was encountered: Unable to send data: DATA

data: The following SMTP error was encountered: Unable to send data: User-Agent: CodeIgniter Date: Wed, 31 Oct 2012 08:36:21 +0100 From: Return-Path: To: test@example.com Subject: =?iso-8859-1?Q?Email_using_Gmail.?= Reply-To: "test@example.com" X-Sender: test@example.com X-Mailer: CodeIgniter X-Priority: 3 (Normal) Message-ID: <5090d4f5df7bb@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="B_ALT_5090d4f5df7d8" This is a multi-part message in MIME format. Your email application may not support this format. --B_ALT_5090d4f5df7d8 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Working fine ! ! --B_ALT_5090d4f5df7d8 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Working fine ! ! --B_ALT_5090d4f5df7d8-- Unable to send data: .

The following SMTP error was encountered: Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.

air4x
  • 5,618
  • 1
  • 23
  • 36
Venkata Krishna
  • 4,287
  • 6
  • 30
  • 53
  • any errors or something else to consider? – Repox Oct 31 '12 at 07:49
  • there are so many errors from debugger............ – Venkata Krishna Oct 31 '12 at 07:55
  • I added errors in my question........ – Venkata Krishna Oct 31 '12 at 07:58
  • 1
    you need to install [`openssl`](http://www.php.net/manual/en/openssl.installation.php) in php – air4x Oct 31 '12 at 08:12
  • 'smtp_host' => 'smtp.googlemail.com', – Nish Oct 31 '12 at 08:53
  • If this is running from your localhost you may need to enable ssl check here: http://stackoverflow.com/questions/5801425/enabling-ssl-with-xampp – Rick Calder Oct 31 '12 at 10:33
  • Nish still getting error hello: The following SMTP error was encountered: Failed to send AUTH LOGIN command. Error: from: The following SMTP error was encountered: to: The following SMTP error was encountered: data: The following SMTP error was encountered: The following SMTP error was encountered: Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method. – Venkata Krishna Oct 31 '12 at 10:38
  • Thanks guys i got it........air4x post it in answer i will accept it – Venkata Krishna Oct 31 '12 at 13:07
  • Have a look at: http://stackoverflow.com/questions/6310573/gmail-smtp-not-working-in-my-hosting-using-codeigniter-framework or http://stackoverflow.com/questions/6487649/setting-up-emails-in-code-igniter-2-02 – jmadsen Nov 03 '12 at 09:30

1 Answers1

2

Man... You should try upload first, when it get done, you try to solve the e-mail problem. And you dont need it: 'smtp_host' => ' ssl:// smtp.googlemail.com' the ssl:// part