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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:09:50+00:00 2026-06-12T02:09:50+00:00

I’m trying to find a way to add additional parameters to an email using

  • 0

I’m trying to find a way to add additional parameters to an email using Codeigniters email class (with the mail() send method). There is no documentation or other information I can find. Do you folks know if there is a way within the framework?

PHP native mail():

mail ( string $to , string $subject , string $message [, string $additional_headers 
       [, string $additional_parameters ]] );

Codeigniter:

$this->load->library('email');
$this->email->from('your@example.com', 'Your Name');
$this->email->to('someone@example.com');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
$this->email->additional_parameters('something_goes_here'); // this is what I need
$this->email->send();
  • 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-12T02:09:52+00:00Added an answer on June 12, 2026 at 2:09 am

    CodeIgniter’s Email Library is just a wrapper for PHP’s mail().

    If you dig into the core and inspect system/libraries/Email.php, _send_with_mail() is the function that kicks-off PHP’s native mail().

    The current implementation under safe mode uses:

    mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str)
    

    The current implmentation without safe mode uses:

    mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str, "-f ".$this->clean_email($this->_headers['From'])
    

    Neither of which allow user-defined content to fill the $additional_parameters variable. You’ll need to extend the CI_Email class to accomplish this:

    In application/libraries/ create a file MY_Email.php with contents:

    <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
    class MY_Email extends CI_Email{
        public $additional_params = "";
        function __construct(){
            parent::__construct();
        }
    
        function additional_params($ap){
            $this->additional_params = $ap;
        }
    
        protected function _send_with_mail(){
            if ($this->_safe_mode == TRUE){
                if ( ! mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str, $this->additional_params)) return FALSE;
                else return TRUE;
            }
            else{
                    if ( ! mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str, "-f ".$this->clean_email($this->_headers['From']) . " " . $this->additional_params)) return FALSE;
                    else return TRUE;
            }
        }    
    
    
    }
    

    Now, to use it:

    $this->email->additional_params('something_goes_here');

    When you call $this->email->send(), this function will take over and append the parameters!

    Haven’t tested any of this. But this is the general idea. Hope it helps.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:
I am doing a simple coin flipping experiment for class that involves flipping a
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.