Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6825505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:02:17+00:00 2026-05-26T22:02:17+00:00

I am currently developing a website with the help of codeigniter and the ion

  • 0

I am currently developing a website with the help of codeigniter and the ion auth library.

I am trying to use ion auth’s standard functionality to reset a users password.

In the library there are 2 functions:

  • forgotten_password($identity)
  • forgotten_password_complete($code)

Both functions (in case validation goes through) send an email to the user. The functions themselves work, but the emails i receive are broken. The emails header is displayed as a part of the emails body. This is how a broken email looks:

Date: Fri, 18 Nov 2011 23:36:32 +0100

From: "Example.com" <admin@example.com>

Reply-To: "admin@example.com" <admin@example.com>

X-Sender: admin@example.com

X-Mailer: CodeIgniter

X-Priority: 3 (Normal)

Message-ID: <4ec6ddf0d26a3@example.com>

Mime-Version: 1.0

Content-Type: multipart/alternative; boundary="B_ALT_4ec6ddf0d26b9"






This is a multi-part message in MIME format.

Your email application may not support this format.



--B_ALT_4ec6ddf0d26b9

Content-Type: text/plain; charset=utf-8

Content-Transfer-Encoding: 8bit



New Password for test_user



Your password has been reset to: 0774b65f5e





--B_ALT_4ec6ddf0d26b9

Content-Type: text/html; charset=utf-8

Content-Transfer-Encoding: quoted-printable



<html>
<body>
    <h1>New Password for test_user</h1>
=09
    <p>Your password has been reset to: 0774b65f5e</p>
</body>
</html>



--B_ALT_4ec6ddf0d26b9--

However I was able to track down the line which is causing the trouble:

$this->ci->email->set_newline("\r\n");

When I comment out this line (in both functions mentioned above), the emails I receive when I reset a users password are fine.

Can someone explain to me the purpose of this line and wether or not it is a good idea to solve this problem by just commenting the line out.

I also found 2 questions

  • Problem sending email with Codeigniter – Headers sent in the message body
  • https://stackoverflow.com/questions/6740672/mime-format-email-breaking-sporadically-in-hotmail-php-codeigniter

referring to the same or at least a similar problem. As they are fairly old and haven’t been answered yet, I created a new one. Hope no one minds.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:02:18+00:00Added an answer on May 26, 2026 at 10:02 pm

    Different operating systems use different characters to determine a new line (the place at which a line breaks to the next line.) In HTML, the equivalent is the <br> tag. Some (old? Mac) traditionally use \r, some (Unix) traditionally use \n, and others (Windows) traditionally use both (\r\n).

    Codeigniter defaults to \n (see documentation), but the writer of ion auth overrode that to use \r\n, which is the standard.

    So, the program parsing the email headers (which at my best guess is *nix-based) sees the non-Unix-standard \r\n line and starts spitting the headers out as part of the body.

    To the best of my knowledge, you’ll get by fine with just \n, which is why Codeigniter defaults to it. Every instance I’ve seen of people with troubles have been people using \r\n and getting the same problem you’re having.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently developing a website in ASP .NET MVC and I require functionality for
I'm currently working on developing an e-commerce website and I'm going to use C#,
I'm currently developing a website which allows the users to upload presentations, documents and
Currently Im developing a website with Zend framework. I need help with my suburb
Currently I'm developing a website with MYSQL INNODB and I need someone to help
I am currently developing a website where many users post topics and the associated
I'm currently developing a website that will make use of PHP scripts and I'd
I'm currently developing a website which stores bookmarks in a MySQL database using PHP
Currently I am developing website in asp.net. I wanted to include spellchecker module into
I am developing a website wherein users are able to add friends. Here, I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.