i want to send some html in email body, but gmail doesn't interpret iframe tag with youtube video. Is it because of security violations or other reasons?
here is my code:
this->load->library('email');
$config['mailtype'] = 'html';
$config['wordwrap'] = TRUE;
$this->email->initialize($config);
$this->email->from('<email>', 'Alega');
$this->email->to('<email>');
$this->email->subject('Email Test');
$this->email->message('<iframe title="YouTube video player" width="480" height="390" src="<url>" frameborder="0" allowfullscreen></iframe>');
$this->email->send();
It's because of security, it's the same reason you can't put javascript or anything external other than images in an email either - it can give the email too much 'power'. (You can put stuff there, it wont be displayed). Sadly this means no reliable flash support either.
In fact, most email readers will not parse even simple tags or CSS because of lack of support, I actually revert to tables just to make sure that the email looks consistent across all the different email clients out there.
Your best/only option is to just link to the video I'm afraid. As mentioned above, Gmail will parse the Youtube links and actually embed them for people who have it enabled.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With