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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:11:33+00:00 2026-05-30T02:11:33+00:00

I’m using PHPMailer for a while now and never really had any problems, but

  • 0

I’m using PHPMailer for a while now and never really had any problems, but last week I installed one of my CMS on a website and the client insisted on having 2 e-mails receiving the contents of the contact form of his website.

Ok, no problem I thought, just adding an e-mail address using the $phpmailer->AddAddress() function. However, adding a second receiver is causing PHPMailer to send the mail twice to both receivers. I tried adding a third receiver to see if I got it three times, but this didn’t change anything. So adding 2+ receivers is causing PHPMailer to send the message twice to all receivers.

There’s nothing strange in my code. It’s a basic PHPMailer example:

$mail             = new PHPMailer();
$mail->AddReplyTo("name@yourdomain.com","First Last");
$mail->SetFrom('name@yourdomain.com', 'First Last');

$mail->AddAddress("info@address.com");
$mail->AddAddress("info@address.nl");
$mail->Subject    = "PHPMailer Test Subject via mail(), basic"; 

$mail->Send();

I’ve ran out of options. I have absolutely no clue where it’s going wrong.

Thanks in advance

—

Just some random thought: I noticed the mailer is defaulted by iso-8859-1 and my site is running utf8. Can there be a “silent” redirect by the server itself?

//EDIT, that ^^ solved my problem

//EDIT2:

Ok, it did not.. today the script worked fine (just 1 mail with 2 receivers) but a moment ago the strange behavior started again. Any tips?

// Solution:

ok, I feel quiet stupid! The answer Zulkhaery Basrul came closest to the actual problem! This is what happened: I was sending an e-mail to multiple addresses in the “to” field. For example:

To: A, B, C

Both A/B are my own adresses. In outlook I had some message rules to put e-mails with certain addressees inside a specific folder. Both A and B had this rule.

When I recieved my e-mail, both mails contained both mailaddresses in the to-field. Causing both of the mails to meet the rule requirements for both rules. Thus keeping the original in one folder and creating a copy in the other (twice).

Thanks for thinking tho 🙂

  • 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-30T02:11:34+00:00Added an answer on May 30, 2026 at 2:11 am

    You can use $SingleTo property.

    From PHPMailer docs:

    $SingleTo

    Provides the ability to have the TO field process individual emails,
    instead of sending to entire ‘TO addresses’

    $mail = new PHPMailer();
    
    $mail->SingleTo = true; //will send mail to each email address individually
    
    
    $mail->AddReplyTo("name@yourdomain.com","First Last");
    $mail->SetFrom('name@yourdomain.com', 'First Last');
    
    $mail->AddAddress("info@address.com");
    $mail->AddAddress("info@address.nl");
    $mail->Subject    = "PHPMailer Test Subject via mail(), basic"; 
    
    $mail->Send();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am reading a book about Javascript and jQuery and using one of the
I'm making a simple page using Google Maps API 3. My first. One marker
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.