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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:21:55+00:00 2026-06-17T14:21:55+00:00

I am using php mail to send mail to all members in a message

  • 0

I am using php mail to send mail to all members in a message thread when a new reply is posted.

            include('Mail.php');
            include('Mail/mime.php');

            // Constructing the email
            $sender = "sender@sender.com";                              // Your name and email address
            //$to= "" ;                         // The Recipients name and email address
            $subject = $Sname." has posted a reply";                                            // Subject for the email

            $html = "<html><body><p> DearMember, <br>    $Sname has replied to one of your posts. </p></body></html>";  
            $crlf = "\n";
            $headers = array(
                            'From'          => $sender,
                            'Return-Path'   => $sender,
                            'Subject'       => $subject,
                            'Bcc'           => $recipients
                            );


            // Creating the Mime message
            $mime = new Mail_mime($crlf);

            // Setting the body of the email
            $mime->setTXTBody($text);
            $mime->setHTMLBody($html);

            $body = $mime->get();
            $headers = $mime->headers($headers);

            // Sending the email
            $mail =& Mail::factory('mail');
            $mail->send(null, $headers, $body);

Right now, I am addressing the recipient as “member”. Is it possible to change that to individual usernames and still use the Bcc function?

  • 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-17T14:21:57+00:00Added an answer on June 17, 2026 at 2:21 pm

    No, you cannot. You can either send the same message to all recipients using a long Bcc list, or you can send one personalized message to each user (calling mail() separately for each one), but there is no way to send a single email which differs for each recipient.

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

Sidebar

Related Questions

As the title said: Is it possible to send an email (using php mail())
I have send an email using php mailer class. mail was sending successfully but
Im using PHP's mail() function to send some emails. But all my mails land
I am trying to send an email using php mail, however, when using an
I'm using PHP to send an attachment in an email, all works as expected
once we send email from php using mail() function, is there any way to
I am using PHP mail() to send daily notice emails. But I noticed that
I have to written the following code to send a mail using PHP in
I am using this code to send mail with php http://www.siteduzero.com/tutoriel-3-35146-e-mail-envoyer-un-e-mail-en-php.html#ss_part_4 . This code
Is it possible to send mail in core php via gmail smtp without using

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.