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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:25:37+00:00 2026-05-29T19:25:37+00:00

I am trying to send a mail from a from in PHP, it’s not

  • 0

I am trying to send a mail from a from in PHP, it’s not working though. Not even a blank email is coming through to the end email. Advice?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Smart Gardens Gravesend | Garden Maintenance</title>
<link href="global.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" media="all" type="text/css" href="menu_style.css" />
        <link rel="stylesheet" href="engine/css/vlightbox.css" type="text/css" />
        <style type="text/css">#vlightbox a#vlb{display:none}</style>
        <link rel="stylesheet" href="engine/css/visuallightbox.css" type="text/css" media="screen" />
        <script src="engine/js/jquery.min.js" type="text/javascript"></script>
</head>
<body>
<div id="wrapper">
<div id="logo2"><img src="images/logo_02.png" width="231" height="101" alt="logo" /></div>
<div class="menu bubplastic horizontal lime">
    <ul>
        <li><span class="menu_r"><a href="about.html"><span class="menu_ar">About Us</span></a></span></li>
        <li class="highlight"><span class="menu_r"><a href="maintenance.html"><span class="menu_ar">Maintenance</span></a></span></li>
        <li><span class="menu_r"><a href="landscaping.html"><span class="menu_ar">Landscaping</span></a></span></li>
        <li><span class="menu_r"><a href="tree.html"><span class="menu_ar">Tree Work</span></a></span></li>
        <li><span class="menu_r"><a href="fencing.html"><span class="menu_ar">Fencing</span></a></span></li>
        <li><span class="menu_r"><a href="contact.php"><span class="menu_ar">Contact Us</a></span>
        </div>
<div id="content">
<form action="<? echo $_SERVER['PHP_SELF']; ?>" method="post">
<table border ="0">
<tr>
  <td width="133">Name:</td><td width="252"><input type="text" size="42" name="name"/></td></tr>
<tr>
  <td>Email:</td><td><input type="text" name="email" size="42"/></td></tr>
<tr><td>Message</td><td><textarea name="message" rows="5" cols="31"></textarea></td></tr>
<tr><td></td><td><input type="submit" value="Submit"/></td></tr>
</table>
</form>
<?php
if(isset($_POST['name']) && isset($_POST['email']) && isset($_POST['message'])){
$name = $_REQUEST['name'] ;
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
$headers = "X-Mailer: php";
mail("mattmaclennan@live.co.uk", "Email from $name",
$message, "From:" . $email, $headers);
echo "Thanks, your email has been sent!";
}
?>
<br />
<br />
<div class="commentbox">
<h2>Caroline Roe, Old Road East, Gravesend</h2>
<p>Smart Gardens have been maintaining our gardens for 4 years now. We are very happy with their personal, friendly and knowledgable service. Highly recommended.</p>
</div>
<div class="commentfooter"></div>
<div class="commentbox">
<h2>Brian Colley, Darnley Road, Gravesend</h2>
<p>The Smart Gardens Team have been caring for our gardens for a number of years . Their conscientious, reliable work demonstrates the strength of their professional knowledge and versatile ability.</p>
<p>They have been able to make worthwhile, constructive suggestions which have led to the development and maturity of the rear garden particularly, in both the hard and soft landscape areas.</p>
<p>Their helpful, friendly and trustworthy nature is second to none and we heartily recommend them for routine maintenance or major project development work.</p>
</div>
<div class="commentfooter"></div>
<div class="commentbox">
<h2>Mrs Hathrill, Windmill Hill, Gravesend</h2>
<p>I have regularly used the services of Smart Gardens for both Maintenance and Landscape projects.</p>
<p>They are conscientious, hard working and always strive for perfection. They are also friendly and approachable. I would not hesitate to recommend them.</p>
</div>
<div class="commentfooter"></div>
</div>
</body>
</html>

The same PHP code has worked on other mailers, but not sure why this one isn’t working :\ thanks!

  • 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-29T19:25:40+00:00Added an answer on May 29, 2026 at 7:25 pm

    There is a good chance that you have an issue with the email server.

    However, the following code appears to be incorrect.

    mail("mattmaclennan@live.co.uk", "Email from $name",
    $message, "From:" . $email, $headers);
    

    Try:

    $headers = "From:" . $email . "\r\n";
    $headers .= "X-Mailer: php\r\n";
    mail("mattmaclennan@live.co.uk", "Email from $name",
    $message, $headers);
    

    Also note, that setting the “From” address to one that doesn’t belong to your domain may cause the message to be blocked at some point (either by your host, or the recipient’s spam filter).
    You might need to set a Reply-To: header, and simply use From: as an email address belonging to your server.

    • 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 an encrypted email with an attachment from PHP, however, my
I am trying to send an email via GMail's SMTP server from a PHP
I am trying to send email using mail() in php. I need the message
I am trying to send an email from PHP using PHPmailer() . I have
I have been trying to send out html emails through a PHP mail script
I am trying to send an HTML mail through PHP, but I can't seem
I am trying to send an email via PHP mail() with attachments. The attachments
I am trying to send an email through php. I have tried sending to
I am trying to send email from my php : $to = 'it@7sisters.in'; $email_from
I am trying to send email using PHP mail. I get the following error:

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.