WPDev.one

wp_mail()

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

Sends an email, similar to PHP's mail function.

Parameters 5 required

Name / Type Description
(string

| string[]) $to Array or comma-separated list of email addresses to send message.

Required
$subject
string

Email subject.

Required
$message
string

Message contents.

Required
(string

| string[]) $headers Optional. Additional headers.

Required
(string

| string[]) $attachments Optional. Paths to files to attach.

Required

Return Value

(bool)
Whether the email was sent successfully.

Function Information

Since Version
1.2.1
Source File
wp-includes/pluggable.php
Advertisement