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") . '
' . __("The field \"SMTP Host\" can not be left blank!", "WP-SMTP") . '
' . __("Options saved.", "WP-SMTP") . '
' . $status . '