Welcome Guest, Not a member yet? Register   Sign In
Sending Codeigniter Views As HTML Content Using PHPMailer
#3

[eluser]ariffin246[/eluser]
[quote author="Aken" date="1344836139"]
Code:
$content = file_get_contents($this->load->view('mail/contact_us', '' , TRUE));

// Wrong, should be:

$content = $this->load->view('mail/contact_us', '' , TRUE);

You're essentially passing the string data from a view as the first parameter of file_get_contents(), which is wrong. Using the TRUE third parameter of $this->load->view() will return the contents as a string, which is all you need.[/quote]

I tested by replacing the code as you mentioned but the function goes through infinite loop and crashes. The email is sent and received successfully but the view is not included in the email.

Any idea why it happens?


Messages In This Thread
Sending Codeigniter Views As HTML Content Using PHPMailer - by El Forum - 08-13-2012, 12:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB