wp_mail ( $to, $subject, $message, $headers = '', $attachments = array() )

  • (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.
  • (bool) Whether the email was sent successfully.
Defined at:
Change Log:
  • 5: .


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.

Related Functions

wp_meta, wp_salt, is_email, wp_title, wp_is_mobile

Top Google Results

User discussions

wpseek mobile