Looking at the snippet you provided the solution seems to be your last solution.
$emails = array( $email, '[email protected]','[email protected]' );
Sending an array of emails, the first one ($email
) being the dynamic email. The second and third would be hard coded values.
This is assuming the email handler is ready to accept an array of emails to mail to.
EDIT
I see some comments regarding your first attempt:
$emails = array( $email, '[email protected], [email protected]' );
This is a valid array – however will pass the value of [email protected], [email protected]
instead of [email protected]
and [email protected]
as separate values – which by first glance is how the code is expecting additional email addresses.
Related Posts:
- How can I send an email using PHP?
- WordPress refuses to send mail, “…your host may have disabled the mail() function”
- How do I override the Message-ID header of wp_mail function?
- How to disable wordpress confirmation email for new users
- Best way to create a user programatically
- Should I use wp_mail or PHP’s mail? [duplicate]
- Mail not sent when I set HTML headers
- Send PDF link in email based on radio button selection
- Woocommerce HTML email option unavailable
- Trigger Woocommerce New User Email
- Processing a subscription form with POST method?
- Different Webhost and using Google Mail server: Is there a better way than SMTP?
- Attaching a pdf to Contact Form 7 e-mail via functions.php [closed]
- Setting up 2 SMTP accounts: 1 for wordpress and 1 for woocommerce
- Set a condition based on WooCommerce checkout city field while placing order
- WooCommerce – Email admin with new user details
- How do you ensure that a user is recognised and available for use only when it is verified through a row in the database called ‘accountVerified’?
- PHP 8, AJAX mail form to function.php doesn’t work
- Capture User Email Address When Filling Out Form
- Send multiple attachments with wp_mail in PHP
- How to retrieve the sender email with wp_mail()?
- Auto 301 to full post permalink? (using : /archive/%post_id% to %post_name% )
- Can I get an email notification when media is uploaded to the media library?
- Woocommerce Email attachments not working – file not being attached
- Get user custom field value on function.php
- Pass return-path additional parameter in wp_mail
- difference between sanitize_email ,FILTER_VALIDATE_EMAIL and input email type in html5
- Use of antispambot with $curauth->email
- How do I attach an invoice PDF to an email in the Dukapress plugin for WordPress?
- Contact form – problem with displaying message about sent mail
- How to setup the Email piping in WordPress plugin?
- Is it secure to use SMTP password in .php file in WordPress website?
- Send an e-mail on address with the link with disliked post
- I want to fusion the product columns in email table order
- Woocommerce checkout page – custom field checkbox value into email
- Changing default WPMU emails to be send thorugh Campaign Monitor Transactional emails
- Send email to users when they get new followers
- How can disable wordpress emails notifications?
- Woocommerce custom field on emails outputs ‘Array’
- Using Custom Javascript and pHp to send email to myself when a user clicks on an input button but only works on Chrome, IE, and Micorosft Edge
- Wp_mail doesnt work
- Trying send mail from Theme page
- get_post_meta is always empty when I use wp_mail
- Cron job to call php to email last 24 hours posts
- How to check “From Email” via WordPress before an email is sent
- How can I prevent wordpress from sending emails
- Dynamic Email Handler with ‘header (“Location: …’
- Customize the summary table of an order in the email
- Why does WordPress not send the user the email to add a password?
- Why is my custom email notification after purchase not sending?
- Check if a menu is empty?
- How To Make Connection To WordPress Data Base In A Plugin?
- Walker class: Problems with understanding how walk() method can be called without error
- How to get the post count for the last x days filtering by categories
- How to create shortcodes that pull custom field data from general settings
- How to display related posts from parent category
- Warning when using
- WordPress shows registration link for non logged users
- How can I resolve the php notice “Constant EMPTY_TRASH_DAYS already defined”
- Use wp_get_recent_posts with search term
- Choose To Display Post Views With An Options Panel
- Prevent Data Resubmission On Page refresh
- Bridging TinyMCE js and WordPress PHP?
- Getting trackpacks/pingbacks for a post via wordpress?
- Loop through categories and display posts title under each dropdown
- is there a benefit in using a constant over get_stylesheet_directory_uri?
- Noindex Posts From Certain Authors In WordPress
- WP Query Leads to 502 Bad Gateway (Timeout Because Query Takes Too Long)
- Get the_content surrounded by instead of
- WordPress forms submissions and PHP files
- how to make an array of post id’s in is_single
- Display an image based on field value
- WordPress call post-ID in jquery
- Hide media for non logged in users
- Generate images with html2canvas and the woocommerce api
- display the months of a specific category
- How to display 8 posts in four columns and 2 rows on a carousel slide?
- How to run php code only for a specific widget on a page and not all widgets on that page?
- Add Link to PHP message
- WooCommerce function not working correctly after moving from the functions.php into a class
- How to check if plugin update process completed in wordpress?
- Filter for product subcategory listing page load
- Conditional Banners
- Reduce Stock Based on Custom Variation Field Rather than Attribute (Working Script)
- How can I get the custom post title?
- how to use auth_redirect() redirect visitor to login page if they are not login when they click account and order page?
- CRON job to update wp_usermeta value each day or week based on server time
- Using Sprit-sheet on WordPress categories
- Find url with base folder and remove extension
- how to edit open graph meta description programmatically and in which file
- How to use foreach and if statement within array of arrays?
- For each 3 posts, show a different post type
- Include a custom field in mysql query
- Headers for Contact Form are wrong
- What is the best way to get the first few post from WordPress in different divs using a loop?
- Display WP posts in 3 responsive columns
- How to change a specific character in a theme option value – replace a space with a plus sign
- How to add Paragraph Tags in WordPress using Visual Composer?
- PHP – Multiple variables in insert post array
- Search custom post type posts only by meta fields?