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 9185731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:20:54+00:00 2026-06-17T19:20:54+00:00

I have some problems, meaning that I don’t receive mail from a form… the

  • 0

I have some problems, meaning that I don’t receive mail from a form…

the code looks like this:

public function send_email(){
        $this->load->library("form_validation");


        $this->form_validation->set_rules("fullName", "Full Name", "required|alpha|xss_clean");
        $this->form_validation->set_rules("email", "Email Address", "required|valid_email|xss_clean");
        $this->form_validation->set_rules("message", "Message", "required|xss_clean");

            if($this->form_validation->run() == FALSE){
                $data["message"] = "";
                $this->load->view("site_header");
                $this->load->view("site_nav");
                $this->load->view("content_comment", $data);
                $this->load->view("site_footer");
            }else{
                $data["message"] = "The email was successfully been sent!";


                $this->load->library("email");


                $this->email->from(set_value("email"), set_value("fullName"));
                $this->email->to("paulharbuz@gmail.com");
                $this->email->subject("Message from our form");
                $this->email->message(set_value("message"));

                $this->email->send();

                echo $this->email->print_debugger();


                $this->load->view("site_header");
                $this->load->view("site_nav");
                $this->load->view("content_comment", $data);
                $this->load->view("site_footer");
            }
    }

And i get an error that looks like this:

Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.**

Is this from my php.ini file?

i’ve set my files reading this part on http://php.net/manual/en/ref.mail.php

i found the solution: create a file in config: email.php that looks like this

<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| EMAIL CONFING
| -------------------------------------------------------------------
| Configuration of outgoing mail server.
| */

$config['wordwrap'] = FALSE;
$config['mailtype'] = 'html';
$config['crlf'] = '\r\n';
$config['charset']='utf-8';
$config['newline']="\r\n";
$config['priority']=1;
$config['protocol']='smtp';
$config['smtp_host']='ssl://smtp.googlemail.com';
$config['smtp_port']='465';
$config['smtp_timeout']='30';
$config['smtp_user']='gcc.sandbox@gmail.com';
$config['smtp_pass']='qwaszx12';
$config['newline']="\r\n";

/* End of file email.php */
/* Location: ./system/application/config/email.php */

then load this in your main controller like: $this->email->initialize($this->config->config); and that’s it!

  • 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-17T19:20:56+00:00Added an answer on June 17, 2026 at 7:20 pm

    simply add this code to you helper file and call the function when you want to send mail the following method to send an email…

     function send_mail($to,$subject,$message) {
        $config = Array(
            'protocol'  => 'smtp',
            'smtp_host' => 'ssl://smtp.googlemail.com',
            'smtp_port' => 465,
            'smtp_user' => 'xxx@xxxx',
            'smtp_pass' => 'xxxx',
            'mailtype'  => 'html', 
            'charset'   => 'iso-8859-1'
        );
        $this->load->library('email',$config);
        $this->email->set_newline("\r\n");
    
        $this->email->from($config['smtp_user'],"Your name");
        $this->email->to($to);
        $this->email->subject($subject);  
        $this->email->message($message);
        $result = $this->email->send();
        return $result;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have some code that looks like this: class Serializer { public: template<class Type>
i have some problems with a Query seem IN dosen't work with Group_concat, that
I have some problems with Javascript. In fact, I'm just newbie in that script
I have some problems sending an id though jquery. I have a form select
My application I have an application design that looks like this: web application layer
I'm having an issue with some asynchronous JavaScript code that fetches values from a
I have some problems with header() function. It works and doesn't work at the
I have some problems with my first Open Graph custom action: I've created a
I have some problems sending mails through SMTP using Spring's MailSender interface and the
I have some problems with OpenCV s cvCanny(...) and the Image data types it

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.