Title: WP_PHPMailer::__construct
Published: April 28, 2025

---

# WP_PHPMailer::__construct( bool $exceptions = false )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_phpmailer/__construct/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/classes/wp_phpmailer/__construct/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_phpmailer/__construct/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_phpmailer/__construct/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_phpmailer/__construct/?output_format=md#wp--skip-link--target)

Constructor.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_phpmailer/__construct/?output_format=md#parameters)󠁿

 `$exceptions`booloptional

Whether to throw exceptions for errors.

Default:`false`

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_phpmailer/__construct/?output_format=md#source)󠁿

    ```php
    public function __construct( $exceptions = false ) {
    	parent::__construct( $exceptions );
    	static::setLanguage();
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-phpmailer.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/class-wp-phpmailer.php#L25)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/class-wp-phpmailer.php#L25-L28)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_phpmailer/__construct/?output_format=md#related)󠁿

| Used by | Description | 
| [wp_mail()](https://developer.wordpress.org/reference/functions/wp_mail/)`wp-includes/pluggable.php` |

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

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_phpmailer/__construct/?output_format=md#changelog)󠁿

| Version | Description | 
| [6.8.0](https://developer.wordpress.org/reference/since/6.8.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_phpmailer%2F__construct%2F)
before being able to contribute a note or feedback.