In wp_mail()
there are filters to adjust from address:
// Plugin authors can override the potentially troublesome default
$phpmailer->From = apply_filters( 'wp_mail_from' , $from_email );
$phpmailer->FromName = apply_filters( 'wp_mail_from_name', $from_name );
However they don’t seem convenient for your needs because they don’t provide access to mailer object at the same time.
You are probably better of using action hook further down
do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) );
to check what $From
field in it holds and adjust if necessary.
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
- Adding multiple emails to a
- 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?
- How do I make an HTML table from a database table?
- dbDelta support for FOREIGN KEY
- How can I save a multiple select array with the settings API for a plug-in options page?
- Initialize WordPress environment to use in a real cron script
- “wp_enqueue_style();” don’t load new edited style
- Allowed memory size of 268435456 bytes exhausted (tried to allocate 64 bytes)?
- How to Add a Link to the Drop-Down User Menu in the Admin Bar?
- Remove username in emails or swap username for email
- List of posts by day of the week
- How to add custom taxonomy slug in CPT permalink?
- What SQL / WordPress queries would need a nonce?
- Creating bulk posts with Youtube videos
- How to test nonce with AJAX – Plugin development
- add_image_size for header_image
- Return a numerical function value in Customizer controls
- Enable custom logo upload if logo is not in header
- theme_root returning a truncated URI
- Only first shortcode gets executed
- What is the latest WordPress that will work on PHP 5.2.17?
- Get all categories post is not in
- Function returns post URLs rather than retrieving Facebook Graph API data
- Error while setting role
- Editing a PHP file to include a small text piece on every page
- trying to put an active hover to my custom nav category buttons [closed]
- Handling repeater data
- Adding Updated Post Date PHP Custom Theme
- Create a a form for custom taxonomy terms
- How to make blog post entries appear as input form instead of just text?
- What is the difference between Null vs Empty (Zero Length) string?
- WP_Query – How to query all of post types categories
- Trying to add Custom Post Type to this functions.php command
- Place product field value as variable in php
- How to get current post id in gform_field_validation gravity forms
- Autoloading Classes in Plugins
- Put a span class in the shortened product title
- Calling header from JavaScript file
- admin menu naming
- Display selected parts from selected pages on the frontpage?
- How can I add more code to this?
- Display custom meta box in my template file
- wp_enqueue_style conflict when using in different action hooks
- WordPress developer
- If the_content’s string length is greater than 0, show post otherwise dont
- wp_enqueue_scripts with JS script as a string
- Why can’t I enter the wordpress admin interface?
- SQL – How to echo out inside of where statement
- How to create different templates for woocommerce single-product.php?
- How can I update a value of a field depending on outside source?
- Restricting access to a file for everyone except logged in users
- WordPress Block Editor Gutenberg running code inside ! is_admin()