CodeIgniter Forums
Email Class SVN - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Email Class SVN (/showthread.php?tid=5278)



Email Class SVN - El Forum - 01-15-2008

[eluser]bardelot[/eluser]
Hi,

- The user guide states that the email class loads the config/email.php automatically but it won't.

- When a config is passed to the "initialize"-function the "clear"-function then sets a "User-Agent"-header (using the old config) but later when sending a "X-Mailer"-header is added (using the new config). So it will end up with:
User-Agent: CodeIgniter
X-Mailer: new useragent

SVN: 788

bardelot


Email Class SVN - El Forum - 01-17-2008

[eluser]bardelot[/eluser]
The problem with the config has been fixed in the svn, and here is an example to the header problem.

Code:
$this->load->library('email');
$list = array ('T1' => '[email protected]', 'T2' => '[email protected]');
foreach ($list as $name => $address) {
  $this->email->to($address);
  $this->email->from('[email protected]');
  $this->email->subject('Here is your info '.$name);
  $this->email->message('Hi '.$name.' Here is the info you requested.');
  $this->email->send();    
  $this->email->clear();
}

In the first email the header will be:
User-Agent: CodeIgniter
X-Mailer: <your config value>

and in the second it is:
User-Agent: <your config value>
X-Mailer: <your config value>

Do you need the "User-Agent" and the "X-Mailer" Header or would one be enough?