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 6957891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:04:13+00:00 2026-05-27T15:04:13+00:00

is there a way to force test the text version of my email template.

  • 0

is there a way to force test the text version of my email template. All my email accounts view HTML, I need to make sure the text version displays properly.

    $mime_boundary = 'Multipart_Boundary_x'.md5(time()).'x';        
    $headers = "MIME-Version: 1.0" . "\r\n";
    $headers.= "Content-Type: multipart/alternative; boundary=" .$mime_boundary. "\r\n";
    $headers.= "Content-Type: text/html; charset=UTF-8" . "\r\n";
    $headers.= "Content-Transfer-Encoding: 7bit" . "\r\n";

    $text_content = file_get_contents('emails/welcome_txt.tpl');
    $html_content = file_get_contents('emails/welcome.tpl');

    $body = "--{$mime_boundary}--\n";
    $body.= "Content-Type: text/plain; charset=charset=us-ascii\n";
    $body.= "Content-Transfer-Encoding: 7bit\n\n";
    $body.= $text_content;
    $body.= "\n\n";
    $body.= "--{$mime_boundary}--\n";

    $body.= "--{$mime_boundary}--\n";
    $body.= "Content-Type: text/html; charset=iso-8859-\n";
    $body.= "Content-Transfer-Encoding: 7bit\n\n";
    $body.= $html_content;
    $body.= "\n\n";
    $body.= "--{$mime_boundary}\n";

    $body = str_replace("{Username}",$en['user'],$html_content);
    mail($en['email'], $subject, $body, $headers, '-f' . $returnpath);
  • 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-27T15:04:13+00:00Added an answer on May 27, 2026 at 3:04 pm

    An easy way to do this without changing your code is, with your Email client, view the original email.

    For example, with Gmail you can go to the top right arrow (next to reply), and select “Message Text Garbled” or “Show original”

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

Sidebar

Related Questions

Is there any way to force a listview control to treat all clicks as
Is there any way to force Outlook to display HTML in the desktop alert
Is there any way to force Text-Mate to use a two-space tab instead of
In Perl, is there a way to force all fatal errors to display a
Is there any way to force a C# application to use a specific version
tl;dr version: Is there a way to force a strict mode for JAX-WS that
Is there any way to force Hudson to give me more detailed test results
Short Version Is there a way to force (or provide a hint to) Microsoft
Is there any way to force an update of software using RunOnce, without having
Is there a way to force the flash garbage collector to clean up freed

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.