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
- How does one suppress a 404 status code in a WordPress page?
- WordPress refuses to send mail, “…your host may have disabled the mail() function”
- Admin bar and fixed header issue?
- Do something after sending email
- How to remove rest api link: in http headers?
- disable wordpress canonical tag meta
- How to add headers to outgoing email?
- Disable h1 and h2 from rich text editor combobox
- wp_mail and BCC headers
- Recommended location to set response headers?
- Is it safe to fix Access-Control-Allow-Origin (CORS origin) errors with a php header directive?
- How do I override the Message-ID header of wp_mail function?
- wp_mail script with jQuery post
- Custom endpoint and X-WP-TotalPages (headers)
- wp_mail – Remove sitename from email subject
- Getting “Cannot modify header information – headers already sent” error on wp-admin only whenever any plugin is activated
- Mail will not send in HTML
- 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?
- Putting content into header.php without using wp_head
- Setting Last Modified HTTP Header on static Home Page
- Few chars getting replaced with ‘=’ in mail content in wp_mail()
- If Modified Since HTTP Header
- wp_mail recipient array not sending?
- wp_mail not recognizing cc and bcc headers
- On form submission how to send 2 email to different users
- How to Configure SMTP on wordpress Cant Send Email
- Image slider to display at the very top of home page
- Remove rel=shortlink from HTTP header
- Getting redirect to happen before header output
- Should I use wp_mail or PHP’s mail? [duplicate]
- If new comment posted in custom post – send notification to custom email from custom field
- How to add line breaks to $email[‘body’] when using auto_core_update_email hook
- How do you log a user out with wp_logout?
- Indenting (tabbing) WP_head
- 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?
- Different custom header image on different page
- 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?
- HTTP Header on specific page is application instead of text
- How to create a CSV on the fly and send as an attachment using wp_mail?
- wp_mail() is not working on server
- Auto-refresh page every minute?
- Must I change the admin user email address while changing the general email address?
- User invite email not delivered – related to subdomain?
- Editing Header Titles of each details in woocommerce Order Email [closed]
- Can I configure WordPress to use postfix without a plugin?
- Is it wrong to put header tags inside WordPress help tabs? [closed]
- Processing a subscription form with POST method?
- wp_mail attachment not working
- Different Webhost and using Google Mail server: Is there a better way than SMTP?
- Email ‘from address’ has a www in it
- Trigger WordPress Actions from Email?
- Adding second Email address for WP user notifications
- Authenticate a user for current request
- Remove link around logo
- PHP mail() works but wp_mail() does not
- Send email button in custom post type backend
- wp_mail not sending attachment
- Want to make header and footer CMS driven sothat Editors can modify its content from wordpress admin section
- Facebook embeds loading the wrong language
- Header: Include Date Published and Date Modified
- WP mail sent to MS Exchange recipients = occasional email corruption?
- Page source contains an http item that makes page insecure; but in php files it’s written as https!
- Cleanup Body_Class
- Banner in WordPress
- PHP 8, AJAX mail form to function.php doesn’t work
- Google Tag Manger – no-script Code Not Found
- Determine what pages are in my header [closed]
- Multisite not using subdomains as hostname in from address when sending emails
- How to remove main domain header title from after sub domain header title
- I want to hide header in the static homepage that I am working on [closed]
- Remove all WordPress HTTP headers (not in-source embeds)
- WordPress 502 | Header Upstream send too big
- WordPress unable to send mail
- How to retrieve the sender email with wp_mail()?
- wp_mail() headers multipart/alternative
- Creating dynamic header and footer files
- wp_mail() not sending email in multisite subdomain
- Not able to send links in email after setting header
- Strange 403 header response
- wp_mail 200 response but no mail sent
- Emailing passwords: Setup installed on home server using XAMPP
- 404 or ugly page on IE, but Firefox, Chrome looks perfect
- Mail function is not working
- Google Apps SMTP for WP MultiSite?
- Changing header text from uppercase to normal [closed]
- Send bulk emails without timeout
- Warning: include(): https:// wrapper is disabled in the server configuration by allow_url_include=0
- What is the best way to send out thousands of emails from a WordPress site? [closed]
- Safe to start a php session on get_header action?