Welcome Guest, Not a member yet? Register   Sign In
Little problem with the email class
#1

[eluser]felyx[/eluser]
Well I used to format my emails like this:

Code:
$message = "Dear blabla,\r\nThank you blabla\r\nSincerely blabla";

The resulting emails were fine but with CI's email class I get the following result:
Dear blabla,rnThank you blablarnSincerely blabla

If I dont use \r\n just press enter then its fine but if I use tab to give some look to my source code then the tabs appear in the email also. If I dont use tabs then my source code will look crappy. So my question is how do you format a multi line email if you have to declare it in a variable?
#2

[eluser]M Moeen uddin[/eluser]
I have used <br> for an enter and send the mail as HTML
#3

[eluser]felyx[/eluser]
[quote author="M Moeen uddin" date="1231849650"]I have used <br> for an enter and send the mail as HTML[/quote]

I want to send plain text e-mail but thanks for the anwer. Smile
#4

[eluser]sophistry[/eluser]
@felyx -

here's the relevant code that is messing with your text email:
Code:
/**
     * Set Body
     *
     * @access    public
     * @param    string
     * @return    void
     */
    function message($body)
    {
        $this->_body = stripslashes(rtrim(str_replace("\r", "", $body)));
    }

given the str_replace() i'm confused why the "slash r" is kept. but, anyway, you could just make a file MY_Email.php and override this message function OR create your own method message_text().

cheers.

EDIT: BTW, i would classify this as a bug if there is not another way to create a text-only email - that would be a serious drawback for an email class... please post here what you do to solve this and if you find another way besides extending the class.




Theme © iAndrew 2016 - Forum software by © MyBB