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?
- Send emails to individual subscribers when CPT post is deleted (trashed)
- Send summary email from a form with wp_mail
- WordPress admin area not sending mail (but works with WP Mail SMTP, Test Mail, and PHP mail() function)
- Include text in echoed hyperlink
- How to put a form with php code into a variable or shortcode?
- Utilize Function in Child Theme / Template File
- Add class to DIV depending on page loaded
- Need oop for wordpress theme? [duplicate]
- Display Youtube Time Automate from Key
- Content filter won’t work
- How to retrive the text : No movie by this actor
- Make a database query using WordPress
- Is the 404 page automatically displayed if a loop returns nothing?
- update_post_meta only updating on last loop of foreach
- How to have different header.php based on the user logged in?
- How do I remove a category from a wordpress loop>
- How can i count the post added in relationship field, theme display
- Link blogname and blogdescription to the Options Framework
- Liking a facebook page from wordpress website?
- Isotope Drop Down Categories Filter Function
- First Byte Time (back-end processing)
- How do I define a lookup table that will work across all PHP elements of the template?
- How to keep track of when a vote is cast?
- trouble with page_id & highlighting current page
- Convert the_permalink() function output into string
- Making my first wordpress template
- How to use array in function to get only value I want
- Apply class to every third list item? [duplicate]
- Only show image from custom field when present
- Cinema site, retrive the movies that actor play in
- How to include custom code on a page that’s set to act as homepage?
- retain querystring values when savincustom options in admin
- PHP if statement works in template files, but not header
- How Can I Edit the Registration Code?
- Error while setting role
- Editing a PHP file to include a small text piece on every page
- Get categories names as an array to use it in theme settings
- Should i use the wordpress Options table or to create database table..?
- variable value disappears in a second loop
- Force Users To Relogin
- unknown issue in ‘header.php’ preventing theme from displaying fully
- Hide a div to subscribers(user role) in one page (is_page)
- Security updates to 3.3.2
- Where is this function’s callback getting its arguments from?
- How can I use a sliced image As banner? [closed]
- persist a variable set in header.php all the way down to footer.php
- Echo title attribute php
- Can a page contain php code?
- Last class on last headline?
- Unable to Find Space in Custom Function