wp_mail_smtp()->assets_url . '/images/providers/google.svg', 'slug' => self::SLUG, 'title' => esc_html__( 'Google / Gmail', 'wp-mail-smtp' ), 'description' => sprintf( wp_kses( /* translators: %s - URL to our Gmail doc. */ __( 'Our Gmail mailer works with any Gmail or Google Workspace account via the Google API. You can send WordPress emails from your main email address or a Gmail alias, and it\'s more secure than connecting to Gmail using SMTP credentials. We now have a One-Click Setup, which simply asks you to authorize your Google account to use our app and takes care of everything for you. Alternatively, you can connect manually, which involves several steps that are more technical than other mailer options, so we created a detailed guide to walk you through the process.

To get started, read our Gmail documentation.', 'wp-mail-smtp' ), [ 'br' => [], 'a' => [ 'href' => [], 'rel' => [], 'target' => [], ], ] ), esc_url( wp_mail_smtp()->get_utm_url( 'https://wpmailsmtp.com/docs/how-to-set-up-the-gmail-mailer-in-wp-mail-smtp/', 'Gmail documentation' ) ) ), 'notices' => [ 'educational' => wp_kses( __( 'The Gmail mailer works well for sites that send low numbers of emails. However, Gmail\'s API has rate limitations and a number of additional restrictions that can lead to challenges during setup.

If you expect to send a high volume of emails, or if you find that your web host is not compatible with the Gmail API restrictions, then we recommend considering a different mailer option.', 'wp-mail-smtp' ), [ 'br' => [], ] ), ], 'php' => '5.6', 'supports' => [ 'from_email' => true, 'from_name' => true, 'return_path' => false, 'from_email_force' => true, 'from_name_force' => true, ], ], $connection ); } /** * @inheritdoc */ public function display_options() { // Do not display options if PHP version is not correct. if ( ! $this->is_php_correct() ) { $this->display_php_warning(); return; } ?> is_pro() ) : ?>
'wp-mail-smtp-setting-' . esc_attr( $this->get_slug() ) . '-one_click_setup_enabled-lite', ] ); ?>

connection_options->is_const_defined( $this->get_slug(), 'client_id' ) ? 'disabled' : ''; ?> id="wp-mail-smtp-setting-get_slug() ); ?>-client_id" spellcheck="false" />
connection_options->is_const_defined( $this->get_slug(), 'client_secret' ) ) : ?> display_const_set_message( 'WPMS_GMAIL_CLIENT_SECRET' ); ?> get_slug(); $value = $this->connection_options->get( $this->get_slug(), 'client_secret' ); UI::hidden_password_field( [ 'name' => "wp-mail-smtp[{$slug}][client_secret]", 'id' => "wp-mail-smtp-setting-{$slug}-client_secret", 'value' => $value, 'clear_text' => esc_html__( 'Remove Client Secret', 'wp-mail-smtp' ), ] ); ?>

display_auth_setting_action(); ?>
process_provider_remove(); $auth = new Auth( $this->connection ); ?> is_clients_saved() ) : ?> is_auth_required() ) : ?>

get_user_info(); if ( ! empty( $user['email'] ) ) { printf( /* translators: %s - email address, as received from Google API. */ esc_html__( 'Connected as %s', 'wp-mail-smtp' ), '' . esc_html( $user['email'] ) . '' ); } ?>

Follow these instructions and then select the From Email at the top of this page.', 'wp-mail-smtp' ), [ 'a' => [ 'href' => [], 'rel' => [], 'target' => [], ], ] ), esc_url( wp_mail_smtp()->get_utm_url( 'https://wpmailsmtp.com/gmail-send-from-alias-wp-mail-smtp/', 'Gmail aliases description - Follow these instructions' ) ) ); ?>

get_capability_manage_options() ) ) { return; } if ( ! isset( $_GET['gmail_remove_nonce'] ) || ! wp_verify_nonce( sanitize_key( $_GET['gmail_remove_nonce'] ), 'gmail_remove' ) ) { return; } if ( $this->connection->get_mailer_slug() !== $this->get_slug() ) { return; } $old_opt = $this->connection_options->get_all_raw(); unset( $old_opt[ $this->get_slug() ]['access_token'] ); unset( $old_opt[ $this->get_slug() ]['refresh_token'] ); unset( $old_opt[ $this->get_slug() ]['user_details'] ); unset( $old_opt[ $this->get_slug() ]['auth_code'] ); $this->connection_options->set( $old_opt ); } }