Broken html email? |
Not sure when it broke... but i haven't been able to send an html email in some time. The email comes through as blank. Subject line reads ok. Text only email works fine. HTML fails. Thoughts?
Thanks. ------------------------------ - CI 3.1.6 - Not extending Mail library. This is the test... PHP Code: ci()->email This is what my mail reader is showing me as the raw email body: Code: Return-Path: <[email protected]>
Figured out why it's breaking, not the fix.
/application/config/email.php PHP Code: <?php defined('BASEPATH') OR die('No direct script access allowed.'); Maybe someone could enlighten me. Possible fix at: http://php.net/manual/en/function.quoted...php#115840 - I haven't investigated though.
I use CI's email class all the time, and it works fine. I always use "\r\n" for newline. I always use SMTP. There's nothing wrong with CI's email class, but if you insist, then try using Swiftmailer. Once I had an email problem, and the host was trying to tell me that it was a CI email class problem, so I switched to Swiftmailer to debug and the problem persisted. It was the host's problem. There is no mystery or magic here. Just use the email class as described in the docs and you should be good.
Can you send to mailtrap?
I've never used mailtrap. The solution, at least in my case, was simple once diagnosed. It's seemingly an issue with PHP's (v5.6 I think) implementation of quoted_printable_encode(), assuming that my code was hitting the condition at system/libraries/Email.php:1516
I haven't dug deeper as it's fixed for now, at least for me. PHP Code: ... |
Welcome Guest, Not a member yet? Register Sign In |