'', priority: 10 ); } /** * The address box, button, and result. * * @return void */ public function render(): void { ?>
' . sprintf( /* translators: 1: site name, 2: date and time */ esc_html__( 'This is a test email from %1$s, sent %2$s. If you can read it, your site can send email.', 'all-in-one-utilities' ), esc_html( $site ), esc_html( wp_date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ) ) ) ) . '
'; add_action( 'wp_mail_failed', array( self::class, 'capture_error' ) ); $sent = wp_mail( $to, $subject, Email::layout( $body, $subject ), array( 'Content-Type: text/html; charset=UTF-8' ) ); if ( $sent ) { wp_send_json_success( array( /* translators: %s: email address */ 'message' => sprintf( __( 'Sent to %s. If it doesn\'t arrive within a few minutes, check the spam folder; if it\'s not there either, your host may be blocking email, and an SMTP service is the usual fix.', 'all-in-one-utilities' ), $to ), ) ); } wp_send_json_error( array( /* translators: %s: error message */ 'message' => sprintf( __( 'WordPress couldn\'t send it: %s', 'all-in-one-utilities' ), '' === self::$error ? __( 'no reason given', 'all-in-one-utilities' ) : self::$error ), ) ); } }