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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:16:16+00:00 2026-06-14T14:16:16+00:00

I am trying to send style information along with an email via PHP mail()

  • 0

I am trying to send style information along with an email via PHP mail() function. Unfortunately, even though my mail client is set to accept styled emails it still just renders as plain html text.

$to = $email;
    $subject = "Subject Details";
    $message='<html><body><table width="600" height="840" border="0" cellpadding="5" cellspacing="5">';
    $message.='<tr><td height="110"><img src="https://user.co.uk/images/logo.jpg" alt="SignDox" width="300" height="100" /></td></tr>';
    $message.='<tr><td height="29" bgcolor="#5C1561">&nbsp;</td></tr>';
    $message.='<tr><td height="537" valign="top">';
    $message.="Message Goes Here\n\n";
    $message.="Username: ".$new_agent_id."\n";
    $message.="Password: ".$pass1."\n\n";
    $message.="To sign in to your user panel follow this link: \n";
    $message.="Inside your admin section you will be able to change your username and password.\n";
    $message.='</td></tr>';
    $message.='<tr><td height="140" bgcolor="#5C1561">&nbsp;</td></tr></table></body></html>';
    $from = "no-reply@sender.co.uk";
    $headers = "From:" . $from;
    mail($to,$subject,$message,$headers);
  • 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-14T14:16:17+00:00Added an answer on June 14, 2026 at 2:16 pm

    You need to define the correct headers in order to send HTML formatted emails. This can be done very simply using:

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

    However, I would urge you to use the PHPMailer Class. This class will handle all headers and anything else you may need. You can easily add attachments, embed images, send via SMTP etc…

    It is a fantastic class, and not to mention the amount you will learn with objects and classes, expecially if you are a newbie to PHP 🙂

    See here for the PHPMailer Class

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

Sidebar

Related Questions

I`m trying to send e-mail via c# and use the following code: public static
I am trying to send a mail from a from in PHP, it's not
I'm trying to use a simple PHP mail() function to create user feedback from
Rails 2.3.11 I'm trying to send an activation-style email whenever a user registers. The
I am trying to send in PHP an HTML email but it always shows
am trying send an array to php file using $_POST ,still always getting an
Trying to send some email in my C# app. I am behind a proxy
I am trying to send an email to customers with html form. here is
I am trying to create an application that will send out style-heavy emails and
I'm trying to send an email with html formatting, but when it arrives (in

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.