Hi @helenyhou:
You can set the header, just not with a parameter. WordPress uses “hooks” and the hooks you need are 'wp_mail_from'
and 'wp_mail_from_name'
hooks.
Here are the hooks you might add to your theme’s functions.php
file to modify the "From:"
header when using wp_mail()
to the email address Helen Hou-Sandi <[email protected]>
:
add_filter('wp_mail_from','yoursite_wp_mail_from');
function yoursite_wp_mail_from($content_type) {
return '[email protected]';
}
add_filter('wp_mail_from_name','yoursite_wp_mail_from_name');
function yoursite_wp_mail_from_name($name) {
return 'Helen Hou-Sandi';
}
Related Posts:
- Can’t change headers / From for wp_mail()
- Sending multipart (text/html) emails via wp_mail() will likely get your domain banned
- How to set SMTP programmatically
- WordPress refuses to send mail, “…your host may have disabled the mail() function”
- disable wordpress canonical tag meta
- Disable h1 and h2 from rich text editor combobox
- wp_mail and BCC headers
- Recommended location to set response headers?
- How do I override the Message-ID header of wp_mail function?
- Custom endpoint and X-WP-TotalPages (headers)
- Additional Option on Custom Header admin
- Include HTML template file in wp_mail
- Email sent from WordPress has HTML tags
- Reset Password – change from name and email address
- How can I use CURLOPT_USERPWD in wp_remote_post?
- Few chars getting replaced with ‘=’ in mail content in wp_mail()
- If Modified Since HTTP Header
- wp_mail not recognizing cc and bcc headers
- On form submission how to send 2 email to different users
- Getting redirect to happen before header output
- If new comment posted in custom post – send notification to custom email from custom field
- Change the headers content type with wp_remote_post
- Mail not sent when I set HTML headers
- How do I call wp_mail from HTML?
- Joining confirmation email
- How to setup SMTP for only one specific wp_mail()
- Why I can’t add a script-code into theme-settings without 403-forbidden?
- Processing a subscription form with POST method?
- Email ‘from address’ has a www in it
- Authenticate a user for current request
- Send email button in custom post type backend
- wp_mail not sending attachment
- Facebook embeds loading the wrong language
- Banner in WordPress
- Multisite not using subdomains as hostname in from address when sending emails
- WordPress unable to send mail
- Creating dynamic header and footer files
- Not able to send links in email after setting header
- What is the best way to send out thousands of emails from a WordPress site? [closed]
- How to Access Script Tags in Header
- Problems accessing stylesheets/scripts loaded in WP header
- Help with filter for wp_notify_moderator()
- Rotate images in header based on date
- How to add some lines to the wp-login.php header via functions.php?
- allowed_http_origins() only works in theme functions.php
- Attach a external file as attachement using wp_mail
- Insert stylesheet into WordPress header?
- Pass return-path additional parameter in wp_mail
- How to register and set http/2 server prefetch for a specific asset?
- Header with content
- WordPress Template not getting my Sub-Header File
- Requiring wp-login.php sends headers automatically
- How to add social follow button to header? [closed]
- Include two headers
- What is this HTTP_REFERRER “WordPress/4.1.2”
- Empty lines in header, how to remove them
- Benefits to using CSS for header image instead of html img tag [closed]
- Export Header and Footer
- Inserting iframe right after on header.php
- Code needs wrapper/container to put footer back in, but where?
- Using wp_mail to send email?
- WordPress woocommerce new order email not working
- Including PHP files in header.php
- Updated : how to make email optional while user registration using default wordpress form
- Using a nonce Content Security Policy header for style-src for inline style elements returns errors
- How can I use an iframe element as my header media?
- How to make my banner (logo image) position on the center
- Easiest way to use relative URLs in my WordPress header
- Should I use do_action in the header file?
- set cookies on certain page only
- How can I remove the product short description from the WooCommerce Mails?
- Custom user registration fields in user_register hook
- Video Header in 2016 theme
- Multisite – SMTP not working on other network sites
- wp_mail() not sending emails with ajax
- wordpress wp mail not changing sender mail
- How do I change top header background color
- Why is http header providing 404 while site is online?
- only header is showing up in posts
- force download a file in template_redirect hook
- video header in desktop view, image header in mobile view
- Asynchronous emailing
- How to send email with wp_mail() with from email taken from contact form instead of the host?
- Wp_mail doesnt work
- show wordpress data without headers
- Header Image instead of dynamic text
- Code to Show for One post only in head
- Removing old code from header
- Random header image but also specific header for certain pages
- How to remove uncategorised posts from WordPress
- get_post_meta is always empty when I use wp_mail
- Dynamically changing header text depending on URL in WordPress html page
- After being hacked Fatal error: Call to undefined function get_header() in 404.php on line 1
- making posts linked outside of WordPress still use the same header and footer
- How change the header color?
- Loading second header.php for other homepage showing double header.
- My CSS, footer and header don’t show up!
- End of script output before headers – multiple apache error_log errors
- Dynamic Email Handler with ‘header (“Location: …’
- WordPress custom header parameter combine with cache