HTML email sending as Text - Help |
[eluser]joehopkins[/eluser]
Hi, I'm sending an Email from localhost - everything works except the HTML is sent as text: email.php Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); model Code: $message='<html> Debug output Code: Your message has been successfully sent using the following protocol: mail Notice the 'Content-Type: text/plain'. The email I receive is just the HTML code. What am I doing wrong? Many thanks. Joe
[eluser]troy_mccormick[/eluser]
I'm not sure if you just left it out or not, but did you initialize your config? Code: <?php
[eluser]Aken[/eluser]
Troy, if you set your email config variables in an email.php config file, you don't need to initialize it. Try displaying the properties of $this->email after you've loaded the library to see if it's receiving the config values properly: Code: $this->load->library('email'); Also, this line of your Email debug output worries me, and may be affecting your results: Code: =?utf-8?Q?CRM_Username_and_Password?=
[eluser]joehopkins[/eluser]
Thanks troy_mccormick I've tried the Code: <?php But no difference. I read this was unnecessary anyway as I've defined it in the CI config folder email.php file. Thanks, Joe
[eluser]joehopkins[/eluser]
Thanks Aken, Here's my output: Code: CI_Email Object I notice the mailtype says 'text'. It's like the default isn't getting overridden. Thanks again, Joe
[eluser]joehopkins[/eluser]
Bump... I'm still having no joy overriding the email config. Can anyone think as to why? Many thanks, Joe
[eluser]fornyhucker[/eluser]
User Guide says: If you send HTML email you must send it as a complete web page. Make sure you don't have any relative links or relative image paths otherwise they will not work. Check is your HTML code valid. May be it will help.
[eluser]joehopkins[/eluser]
Thanks forneyhucker, My HTML code is valid and there are no relative links or image paths. I've tried sending the HTML email as a view but exactly the same result. It seems that the config just won't get overridden. Thanks, Joe |
Welcome Guest, Not a member yet? Register Sign In |