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

  • Home
  • SEARCH
  • 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 6010797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:10:04+00:00 2026-05-23T02:10:04+00:00

We send emails in plain text from PHP using CodeIgniter (v1.7) and also PHPMailer

  • 0

We send emails in plain text from PHP using CodeIgniter (v1.7) and also PHPMailer (v5.1). Current production setup uses a cheapie SMTP relay, plan is to switch to a CritSend or SendGrid. We are testing the options now from a Rackspace Cloud server.

When we use SendGrid SMTP all “\r\n” newlines in the emials end up being doubled up, so end up as “\r\n\r\n”.

All works fine when using CritSend SMTP and also two other SMTP servers.

SendGrid tech support don’t think it is anything to do with their system, but have heard of another client with the same issue and apparently it got solved with a config change on the client’s side.

Anyone experienced this?

This isn’t critical for us as CritSend works well and seems as good as SendGrid on features, so we will go with them. BUT being a curious type, I just can’t let this go 🙂

Usual setup: PHP script -> sendmail/Postfix -> external SMTP relay -> ….

To test the different SMTP relays I change the postfix config, only SendGrid gives the extra newlines all other SMTP options work fine. If I dump the email via CodeIgniter email class debug function it looks fine before it goes to postfix.

Alternate setup: PHP script (either CI mail class or PHPMialer) -> external SMTP relay -> ….

To test the different SMTP relays I change the SMTP settings in the CI email config or PHPMialer config. Only SendGrid gives the extra newlines all other SMTP options work fine.

There aren’t all that many options to play with as far as I can see. I tried “utf-8” and “ISO-something or other”, all newlines on our side are “\r\n”…… seesm like some very obscure bug somewhere.

Any ideas?

  • 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-23T02:10:05+00:00Added an answer on May 23, 2026 at 2:10 am

    OK, a bit more experimenting and these settings make plain text emails go trough SendGrid nicely from PHPMailer:

        $mailer->CharSet    = "utf-8";
        $mailer->LE         = "\r\n";
        $mailer->Encoding   = "quoted-printable";
        $mailer->WordWrap   = 80;
    

    The “quoted-printable” part is the key.

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

Sidebar

Related Questions

I'd like to send plain text emails from a Rails app. In my mail
I have a problem sending plain text emails using PHPMailer. I have text that
At the moment we are using MAPI to send a plain text email from
I have a script set up to send out multipart emails; plain text and
I am using DoCmd.SendObject to send emails from MS access 2003. It opens the
I am using PHP to send emails on demand to clients. I have a
We currently send an email notification in plain text or html format. Our environment
I need to send emails to a list of IDs from the contact application,
I am able to send emails using the typical C# SMTP code across Exchange
I'm trying to send emails from a system that connects to internet through a

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.