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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:54:00+00:00 2026-06-15T17:54:00+00:00

I am just wondering if anybody sees any error here, the code executes but

  • 0

I am just wondering if anybody sees any error here, the code executes but I never get the email, any suggestions?

$to = $_POST['to_email'];
$subject = $_POST['subject'];
$message='<p><b>Message:</b> '.str_replace("\n.", "\n..", $_POST['message']).'</p>';

$headers = "From: " . strip_tags($_POST['from_email']) . "\r\n";
$headers .= "Reply-To: ". strip_tags($_POST['from_email']) . "\r\n".
        'X-Mailer: PHP/' . phpversion();

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-15T17:54:01+00:00Added an answer on June 15, 2026 at 5:54 pm

    This will depend on the setup of PHP.

    There are a number of things PHP can do – the most common are queue the email to a local mail server (common on linux, less so on windows) or talk to an external mail relay and queue the mail there (usually requires authentication unless it’s an open relay which is rare). It’s also possible to write to file.

    All that the mail() function guarantees if there are no warnings is that the email has been queued to the location specified in the php.ini file.

    The first thing to do is check that mail is reporting success…

    $Success = @mail($to, $subject, $message, $headers);
    if(!$Success) {
        print "Failed to queue email";
    }
    

    The next thing you need to do is check your php.ini config to see how email is configured. Make sure it points at a valid mail server with the correct credentials. If you’re on linux and using a local mail server like postfix, check that it’s running (something like /etc/init.d/postfix status depending on your distro)

    As mentioned by @FlorianKasper, SMTP as an option is only available on Windows. If you can clarify exactly what OS you’re using, we may be able to help further.

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

Sidebar

Related Questions

Was just wondering if anybody can look at the following code and explain to
Hey everyone, I was just wondering whether anybody had any experience with displaying svg
Just wondering if anybody has run Scala app or web-app on Java Real-Time system?
Im just wondering if theres a recommended syntax validator out there anybody can recommend?
just wondering if there is a way to reduce the amount of code needed
Just wondering, having the following simple code: var object1 = { name: function (){
Just wondering when do you actually use $.get(index); I am a bit confused on
I was just wondering if anybody else has had the same problem as me.
Short question: Has anybody got any C# code to parse robots.txt and then evaluate
Just wondering if anybody knows how to recreate the touch lever action ? http://www.wired.com/geekdad/wp-content/uploads/2011/08/JJ-jackpot.jpg

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.