wp_mail
wp_mail ( $to, $subject, $message, $headers = '', $attachments = array() )
Parameters:- (string|string[]) to Array or comma-separated list of email addresses to send message.
- (string) subject Email subject.
- (string) message Message contents.
- (string|string[]) headers Optional. Additional headers.
- (string|string[]) attachments Optional. Paths to files to attach.
Returns:- (bool) Whether the email was sent successfully.
Defined at:Change Log: - Introduced in WordPress: 1.2.1
- Deprecated in WordPress: —
Description
Sends an email, similar to PHP's mail function.A true return value does not automatically mean that the user received the
email successfully. It just only means that the method used was able to
process the request without any errors.
The default content type is `text/plain` which does not allow using HTML.
However, you can set the content type of the email by using the
{@see 'wp_mail_content_type'} filter.
The default charset is based on the charset used on the blog. The charset can
be set using the {@see 'wp_mail_charset'} filter.