Welcome Guest, Not a member yet? Register   Sign In
Including XML files in an email template
#1

[eluser]omed habib[/eluser]
I'm sending out an email, but the entire document is an XML file, which I'm emailing like this:
Code:
// Load the XML template
$emailbody = $this->load->view('emailtemplate.xml', $data, true);    
// Send the email
$this->email->from('omed@omed', 'Omed');
$this->email->to([email protected]);
$this->email->subject('XML File');
$this->email->message($emailbody);        
$this->email->send();
In my XML file, I have certain variables that are being passed to it through $data (see above) which seem to cause no problems. The problem is, in my XML file, the following XML tags are generating errors:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<?adf version="1.0"?>
How do I escape these?
Thanks!
Omed
#2

[eluser]omed habib[/eluser]
Nevermind.. looks like:
Code:
<? echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
Works!




Theme © iAndrew 2016 - Forum software by © MyBB