Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8371345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:08:23+00:00 2026-06-09T14:08:23+00:00

I have seen the same question on this and many other websites but the

  • 0

I have seen the same question on this and many other websites but the solutions they gave do not work for me. So i am asking again.

To send mail i wrote the following code

<?php

class Email extends CI_Controller{
function __construct()
{
    parent::__construct();
}

function index()
{
    $config = Array(
        'protocol' => 'smtp',
        'smtp_host' => 'ssl://smtp.googlemail.com',
        'smtp_port' => 465,
        'username' => 'mymail@gmail.com',
        'password' => 'password' 
    );

    $this->load->library('email', $config);
    $this->email->set_newline("\r\n");

    $this->email->from('mymail@gmail.com', 'mymail bcc');
    $this->email->to('mymail@gmail.com');
    $this->email->subject('This is a test email');
    $this->email->message('Oops This is Great.');

    if($this->email->send())
    {
        echo 'Your email was sent';       
    }

    else
    {
        show_error($this->email->print_debugger());
    }
       }
       }

I installed openssl and also uncommented the line extension=php_openssl.dll from php.ini. But i get the following erros

  An Error Was Encountered

   220 mx.google.com ESMTP qp6sm2730344pbc.55

    hello: 250-mx.google.com at your service, [119.30.39.78]
    250-SIZE 35882577
     250-8BITMIME
     250-AUTH LOGIN PLAIN XOAUTH
     250 ENHANCEDSTATUSCODES

     from: 530-5.5.1 Authentication Required. Learn more at
     530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 qp6sm2730344pbc.55

     The following SMTP error was encountered: 530-5.5.1 Authentication Required. Learn
      more          at          
     530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 qp6sm2730344pbc.55

     to: 530-5.5.1 Authentication Required. Learn more at
     530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 qp6sm2730344pbc.55

     The following SMTP error was encountered: 530-5.5.1 Authentication Required. 
     Learn more at 
     530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 qp6sm2730344pbc.55

     data: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 
     http://support.google.com/mail/bin/answer.py?answer=14257 qp6sm2730344pbc.55

     The following SMTP error was encountered: 530-5.5.1 Authentication Required. Learn more at
      530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 qp6sm2730344pbc.55
     502 5.5.1 Unrecognized command. qp6sm2730344pbc.55
     The following SMTP error was encountered: 502 5.5.1 Unrecognized command. qp6sm2730344pbc.55
     Unable to send email using PHP SMTP. Your server might not be configured to send
      mail using this method.

When i use parent::CI_Controller(); i get a fatal error Fatal error: Call to undefined method CI_Controller::CI_Controller() in C:\wamp\www\test\application\controllers\email.php on line 6
Though i am using php 5.4.3

Please let me know what i am missing here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T14:08:24+00:00Added an answer on June 9, 2026 at 2:08 pm

    The built in Mail class uses the key names smtp_user and smtp_pass for smtp credentials.

    Change the username and password params in your $config array to smtp_user and smtp_pass.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have seen this same question in many forms on this site and in
I have seen several questions with people asking about the same problem but none
This question is similar to my previous question but not the same ... please
I have seen many questions in this (and others) forum with the same title,
Haven't seen many Geneva related questions yet, I have posted this question in the
Many posts on different aspects of this question but I haven't seen a post
I have been pouring over many forums and questions similar (but not the same)
So, this question has been asked lots, and i have seen many different answers,
I have seen the related question here: An object with the same key already
I have seen many posting this issue in SO. I have gone through those

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.