CodeIgniter Forums

Full Version: Loading Email Body From A File
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]omed habib[/eluser]
Hey guys,

I'm trying to load the body of an email from an external file. I assumed the way to do this is this:
$this->email->from('[email protected]', 'Sender');
$this->email->to('[email protected]');

$emailbody = $this->load->view('contactus/emailtemplate');            


This doesn't work and only sends a blank email. Any ideas anyone?

El Forum

try this

$emailbody = $this->load->view('contactus/emailtemplate',array(),true);

El Forum

[eluser]omed habib[/eluser]
Worked perfect, thanks!