[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * WordPress PHPMailer class. 4 * 5 * @package WordPress 6 * @since 6.8.0 7 */ 8 9 /** 10 * WordPress PHPMailer class. 11 * 12 * Overrides the internationalization method in order to use WordPress' instead. 13 * 14 * @since 6.8.0 15 */ 16 class WP_PHPMailer extends PHPMailer\PHPMailer\PHPMailer { 17 18 /** 19 * Constructor. 20 * 21 * @since 6.8.0 22 * 23 * @param bool $exceptions Optional. Whether to throw exceptions for errors. Default false. 24 */ 25 public function __construct( $exceptions = false ) { 26 parent::__construct( $exceptions ); 27 $this->setLanguage(); 28 } 29 30 /** 31 * Defines the error messages using WordPress' internationalization method. 32 * 33 * @since 6.8.0 34 * 35 * @param string $langcode Optional. Unused. ISO 639-1 2-character language code. Default 'en'. 36 * @param string $lang_path Optional. Unused. Path to the language file directory. Default empty string. 37 * @return true Always returns true. 38 */ 39 public function setLanguage( $langcode = 'en', $lang_path = '' ) { 40 $this->language = array( 41 'authenticate' => __( 'SMTP Error: Could not authenticate.' ), 42 'buggy_php' => sprintf( 43 /* translators: 1: mail.add_x_header. 2: php.ini */ 44 __( 45 'Your version of PHP is affected by a bug that may result in corrupted messages. To fix it, switch to sending using SMTP, disable the %1$s option in your %2$s, or switch to MacOS or Linux, or upgrade your PHP version.' 46 ), 47 'mail.add_x_header', 48 'php.ini' 49 ), 50 'connect_host' => __( 'SMTP Error: Could not connect to SMTP host.' ), 51 'data_not_accepted' => __( 'SMTP Error: data not accepted.' ), 52 'empty_message' => __( 'Message body empty' ), 53 /* translators: There is a space after the colon. */ 54 'encoding' => __( 'Unknown encoding: ' ), 55 /* translators: There is a space after the colon. */ 56 'execute' => __( 'Could not execute: ' ), 57 /* translators: There is a space after the colon. */ 58 'extension_missing' => __( 'Extension missing: ' ), 59 /* translators: There is a space after the colon. */ 60 'file_access' => __( 'Could not access file: ' ), 61 /* translators: There is a space after the colon. */ 62 'file_open' => __( 'File Error: Could not open file: ' ), 63 /* translators: There is a space after the colon. */ 64 'from_failed' => __( 'The following From address failed: ' ), 65 'instantiate' => __( 'Could not instantiate mail function.' ), 66 /* translators: There is a space after the colon. */ 67 'invalid_address' => __( 'Invalid address: ' ), 68 'invalid_header' => __( 'Invalid header name or value' ), 69 /* translators: There is a space after the colon. */ 70 'invalid_hostentry' => __( 'Invalid hostentry: ' ), 71 /* translators: There is a space after the colon. */ 72 'invalid_host' => __( 'Invalid host: ' ), 73 /* translators: There is a space at the beginning. */ 74 'mailer_not_supported' => __( ' mailer is not supported.' ), 75 'provide_address' => __( 'You must provide at least one recipient email address.' ), 76 /* translators: There is a space after the colon. */ 77 'recipients_failed' => __( 'SMTP Error: The following recipients failed: ' ), 78 /* translators: There is a space after the colon. */ 79 'signing' => __( 'Signing Error: ' ), 80 /* translators: There is a space after the colon. */ 81 'smtp_code' => __( 'SMTP code: ' ), 82 /* translators: There is a space after the colon. */ 83 'smtp_code_ex' => __( 'Additional SMTP info: ' ), 84 'smtp_connect_failed' => __( 'SMTP connect() failed.' ), 85 /* translators: There is a space after the colon. */ 86 'smtp_detail' => __( 'Detail: ' ), 87 /* translators: There is a space after the colon. */ 88 'smtp_error' => __( 'SMTP server error: ' ), 89 /* translators: There is a space after the colon. */ 90 'variable_set' => __( 'Cannot set or reset variable: ' ), 91 ); 92 93 return true; 94 } 95 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated : Fri May 23 08:20:01 2025 | Cross-referenced by PHPXref |