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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:15:05+00:00 2026-06-08T20:15:05+00:00

I am trying to send an HTML email with the PHP code below. I

  • 0

I am trying to send an HTML email with the PHP code below. I think that the headers are causing problems but I don’t know how to fix them and googling has yielded no helpful results. Thank you!

$emailBody = 'Hello, Thank you for signing up for our website. Please confirm your email. <a href = "'.CONFIRM_PAGE.'&code='.$currentEmailProperties[1].'&addr='.urlencode($currentEmailProperties[0]).'&">Confirm email address</a>';
$emailBody = wordwrap($emailBody,70);
$headers = 'From: '.FROM_ADDRESS.' \r\n ';
$headers .= 'Content-type: text/html \r\n';
$headers .= "MIME-Version: 1.0\r\n";
mail($currentEmailProperties[0],'Welcome to Our Website',$emailBody,$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-08T20:15:08+00:00Added an answer on June 8, 2026 at 8:15 pm

    Escape sequences are not evaluated when used in single quotes. Place them in double quotes, e.g.:

    $headers = 'From: ' . FROM_ADDRESS . "\r\n";
    

    From the manual:

    Note: Unlike the double-quoted and heredoc syntaxes, variables and
    escape sequences for special characters will not be expanded when they
    occur in single quoted strings.

    Reference

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

Sidebar

Related Questions

i am trying to send email using jquery and php. my html code is
I am trying to send an html email with PHP and it keeps coming
I am trying to send email using PHP. The email is an HTML email
I'm trying to send an email with html formatting, but when it arrives (in
Hi there I'm trying to send an HTML email through a PHP webform. The
I am trying to send an HTML mail through PHP, but I can't seem
Trying to send a PHP email the easy way but I cannot work out
Trying to have a PHP script send an email that contains two images that
I am trying to send an HTML email using Perl. open(MAIL,|/usr/sbin/sendmail -t); ## Mail
I am trying to send an email to customers with html form. here is

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.