EllisLab text mark
Advanced Search
     
Email HEADERS with “Email” class
Posted: 24 September 2010 11:16 AM   [ Ignore ]
Avatar
Joined: 2010-08-22
18 posts

How does one set the Headers for an email sent via the Email class ($this->email->)?

 Signature 
$knowledge++; 
 
Posted: 25 September 2010 05:26 AM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2009-04-15
453 posts

I believe one looks in the manual?

http://ellislab.com/codeigniter/user-guide/libraries/email.html

I think “Setting Email Preferences” is what you are looking for, or have I misunderstood?

 Signature 

Code By Jeff

Mahana Messaging Library

Problem with your query? Did you run

$this->db->last_query(); 

before you came to the forums for help?

 
Posted: 30 September 2010 11:17 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2010-08-22
18 posts
jmadsen - 25 September 2010 09:26 AM

I believe one looks in the manual?

http://ellislab.com/codeigniter/user-guide/libraries/email.html

I think “Setting Email Preferences” is what you are looking for, or have I misunderstood?

thanks… i didn’t know that the SERVER CONFIG could do that? btw- your attempt at satire is ALMOST as obnoxious as my questions smile

 Signature 
$knowledge++; 
 
Posted: 01 January 2011 10:36 AM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Joined: 2010-11-07
37 posts

Can you explain further? I don’t see how one sets the message headers.

 
Posted: 01 January 2011 05:18 PM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2009-06-19
6267 posts

If you need to set your own headers please read the following!

CodeIgniter User Guide - Output Class

InsiteFX

 Signature 

Ceritfied State of CT Computer Programming Teacher.
Custom Designed Icons, eBook Covers Software Boxes. CD, DVD Etc. New iPhone® Tab Bar Icons and iPhone® Applications Icons.

STOP! Before posting your questions, remember the WWW Golden rule:
What did you try? What did you get? What did you expect to get?

Input -> Controller | Processing -> Model | Output -> View

 
Posted: 01 January 2011 09:53 PM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Joined: 2010-11-07
37 posts

Yes, but does that work for emails? If so, how does one do that?

 
Posted: 02 January 2011 12:18 AM   [ Ignore ]   [ # 6 ]   [ Rating: 0 ]
Avatar
Joined: 2009-06-19
6267 posts

The Email Library sends it’s own headers!

You do need o set the config values for it.

Best place to learn is look at the Email class php file.

InsiteFX

 Signature 

Ceritfied State of CT Computer Programming Teacher.
Custom Designed Icons, eBook Covers Software Boxes. CD, DVD Etc. New iPhone® Tab Bar Icons and iPhone® Applications Icons.

STOP! Before posting your questions, remember the WWW Golden rule:
What did you try? What did you get? What did you expect to get?

Input -> Controller | Processing -> Model | Output -> View

 
Posted: 02 January 2011 06:37 AM   [ Ignore ]   [ # 7 ]   [ Rating: 0 ]
Joined: 2010-11-07
37 posts

The userguide doesn’t mention anything about email headers. But I will have a look at the class file itself.

 
Posted: 23 May 2012 08:52 AM   [ Ignore ]   [ # 8 ]   [ Rating: 0 ]
Avatar
Joined: 2008-01-31
201 posts

I know it’s a ways back now, but wondering if anyone has made any progress on this, looks like I’ll need to extend the core, or am I missing something?

 Signature 

Greg Guepy - Skattabrain

 
Posted: 23 May 2012 09:04 AM   [ Ignore ]   [ # 9 ]   [ Rating: 0 ]
Avatar
Joined: 2008-01-31
201 posts

Here, maybe of value for someone… very simple though…

Place in application/libraries/MY_Email.php

<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class 
MY_Email extends CI_Email {
 
 
public function set_custom_header($header_name=''$header_value '')
 
{
  
if($header_name==''{
   
return FALSE;
  
}

  $this
->_set_header($header_name$header_value);

  return 
$this;
 
}

 Signature 

Greg Guepy - Skattabrain

 
Posted: 12 June 2012 12:51 PM   [ Ignore ]   [ # 10 ]   [ Rating: 0 ]
Joined: 2011-11-04
244 posts
skattabrain - 23 May 2012 09:04 AM

Here, maybe of value for someone… very simple though…

Place in application/libraries/MY_Email.php

<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class 
MY_Email extends CI_Email {
 
 
public function set_custom_header($header_name=''$header_value '')
 
{
  
if($header_name==''{
   
return FALSE;
  
}

  $this
->_set_header($header_name$header_value);

  return 
$this;
 
}

Thanks. Just realized all my HTML emails were getting destroyed because they weren’t quoted-printable encoded

 
Posted: 01 November 2012 07:35 PM   [ Ignore ]   [ # 11 ]   [ Rating: 0 ]
Joined: 2012-10-29
118 posts
$this->load->library('email');
    
$this->email->from('email@email.com''Ben Igniter');
    
$this->email->to($_POST['email']);
    
$this->email->subject('CodeIgniter');
    
$this->email->message('Sending a test email');
    
$this->email->send();