wsOptions = array(); $this->wsOptions["from"] = sanitize_email( trim( $_POST['wp_smtp_from'] ) ); $this->wsOptions["fromname"] = sanitize_text_field( trim( $_POST['wp_smtp_fromname'] ) ); $this->wsOptions["host"] = sanitize_text_field( trim( $_POST['wp_smtp_host'] ) ); $this->wsOptions["smtpsecure"] = sanitize_text_field( trim( $_POST['wp_smtp_smtpsecure'] ) ); $this->wsOptions["port"] = is_numeric( trim( $_POST['wp_smtp_port'] ) ) ? trim( $_POST['wp_smtp_port'] ) : ''; $this->wsOptions["smtpauth"] = sanitize_text_field( trim( $_POST['wp_smtp_smtpauth'] ) ); $this->wsOptions["username"] = defined( 'WP_SMTP_USER' ) ? WP_SMTP_USER : sanitize_text_field( trim( $_POST['wp_smtp_username'] ) ); $this->wsOptions["password"] = defined( 'WP_SMTP_PASS' ) ? WP_SMTP_PASS : sanitize_text_field( trim( $_POST['wp_smtp_password'] ) ); $this->wsOptions["deactivate"] = ( isset($_POST['wp_smtp_deactivate'] ) ) ? sanitize_text_field( trim( $_POST['wp_smtp_deactivate'] ) ) : ''; update_option("wp_smtp_options", $this->wsOptions); if ( ! is_email($this->wsOptions["from"] ) ) { echo '

' . __("The field \"From\" must be a valid email address!", "WP-SMTP") . '

'; } elseif (empty($this->wsOptions["host"])) { echo '

' . __("The field \"SMTP Host\" can not be left blank!", "WP-SMTP") . '

'; } else { echo '

' . __("Options saved.", "WP-SMTP") . '

'; } } // Catch the test form if ( isset( $_POST['wp_smtp_test'] ) && isset( $_POST['wp_smtp_nonce_test'] ) ) { if ( ! wp_verify_nonce( trim( $_POST['wp_smtp_nonce_test'] ), 'my_ws_nonce' ) ) { wp_die('Security check not passed!'); } $to = sanitize_text_field( trim( $_POST['wp_smtp_to'] ) ); $subject = sanitize_text_field( trim( $_POST['wp_smtp_subject'] ) ); $message = sanitize_textarea_field(trim( $_POST['wp_smtp_message'] ) ); $status = false; $class = 'error'; if ( ! empty( $to ) && is_email( $to ) && ! empty( $subject ) && ! empty( $message ) ) { try { $result = wp_mail( $to, $subject, $message ); } catch (Exception $e) { $status = $e->getMessage(); } } else { $status = __( 'Some of the test fields are empty or an invalid email supplied', 'wp-smtp' ); } if ( ! $status ) { if ( $result === true ) { $status = __( 'Message sent!', 'wp-smtp' ); $class = 'success'; } else { $status = $this->phpmailer_error->get_error_message(); } } echo '

' . $status . '

'; } $ws_nonce = wp_create_nonce('my_ws_nonce'); ?>

WP SMTP Gmail Yahoo! Microsoft 163 QQ