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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:42:06+00:00 2026-06-08T00:42:06+00:00

I realize that this is similar to this question , however, I only get

  • 0

I realize that this is similar to this question, however, I only get a double email when sending to myself. I have sent emails to others with the same script, and they get a single email. This is the email script:

<?php
  function sendEmail( $recipient, $sub, $msg )
  {
    $to      = $recipient;
    $subject = $sub;
    $message = $msg;

    mail( $to, $subject, $message );
  }
?>

The code calling this is this:

if( $retVal != FALSE ) // No errors in execution of report generation
{
  $subject = "Successful Report";
  $message = "The report was successfully generated.";
  // Notify people about success
  sendEmail( $mailto, $subject, $message );

  echo "Successful report generation\n";
}
else // Error in report generation
{
  $subject = "Unsuccessful Report";
  $message = "The report failed to generate.";
  // Notify people about failure
  sendEmail( $mailto, $subject, $message );

  echo "Report generation was unsuccessful\n";
}

where $retval is the return value of system(). Can anyone shed some light on this issue? Or is this something that can be overlooked?

Thanks very much

-rusty

  • 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-08T00:42:07+00:00Added an answer on June 8, 2026 at 12:42 am

    Based on the conversation: You are the only recipient that is receiving double email, and the string “Successful report generation” only prints once. It sounds like PHP is not the culprit here, rather something outside of PHP, such as the MTA.

    Take a look at the headers of the two email you receive, particularly the MessageID header. If they are identical, then a single email was sent from PHP (good!) and somewhere along the line it got delivered to you twice.

    If they are not identical (messy), then PHP did in fact send out two emails (not likely) or there is a resender somewhere between PHP and your mail client.

    In the later case, I would take a deeper look at the headers in your email, to determine the source and route of each email, as well as the envelope to determine where the MTA though it was sending mail to.

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

Sidebar

Related Questions

I realize that this question has been asked 100times but none that I have
I realize that there was a similar question asked here , but this is
Note: I realize that this is probably an open-ended question, so go ahead and
While I realize that this question has been asked once or twice ago but
I realize that the answer to this question is likely quite obvious (if somewhat
I realize that a SO user has formerly asked this question but it was
I asked this question in the restkit google group, but realize now that it
I realize that there are many questions similar to this one, but having looked
I realize that this is similar to an existing post here, What's the Point
I realize that there are similar questions , but my question is slightly different:

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.