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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:36:20+00:00 2026-06-10T21:36:20+00:00

For some reason my php mail() function does not send html, Instead of <a

  • 0

For some reason my php mail() function does not send html,

Instead of <a href="mysite">link</a> it shows just shows link as plain text.

Any ideas?

this is the headers I used:

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";

// Additional headers
$headers .= 'From: My Automated Message <robot@mysite.cc>' . "\r\n";

And invoked as follows:

try {
    if (@mail($to_email, $subject, $message, $headers)){
        echo "<span style=\"color:#0D0; font:10pt Tahoma;font-weight:bold;\">{$SENT_MESSAGE}</span><br><br>"; 
        return true;
    } else {
        $tmp=error_get_last();
        throw new Exception($tmp['message']);
    }
} catch (Exception $e) {
    echo "<span style=\"color:red; font:10pt Tahoma;font-weight:bold;\">Error: ".$e->getMessage()."</span><br><br>";
}

I also tried to send the mail without headers, but then again it shows the link as plain text like this: <a href="mysite">link</a>

  • 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-06-10T21:36:22+00:00Added an answer on June 10, 2026 at 9:36 pm

    Try this header

      $headers = 'From: Name<address@domain.com>' . "\r\n" .
           'Content-Type: text/html; charset=UTF-8' . "\r\n" .
           'MIME-Version: 1.0' . "\r\n" .
           'Content-Transfer-Encoding: base64' . "\r\n" .
           'X-Mailer: PHP/' . phpversion();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason the php mail() function is not working properly on a site
For some reason, my PHP mail is not sending. This is my script: $tom
Hi guys for some weird reason I'm unable to send email using zend mail
For some reason this PHP code below will not work, I can not figure
For some reason my PHP function call <? r(); ?> returns a fatal error.
I'm trying to send mails using PHP. For some reason when I receive the
For some reason, when php mail() is sent to a text number (via email)
for some reason my php script doesn't delete multiple images, it just delete the
For some reason This php script won't echo anything: <?php setcookie(pop,'hi',time()+604800); echo $HTTP_COOKIE_VARS['pop']; ?>
I know PHP 5 already supports SQLite but for some reason I can't get

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.