user_email ) ) ? $current_user_obj->user_email : get_option( 'admin_email' ); $redirect_uri_raw = admin_url( 'admin.php?page=aio-settings&tab=smtp' ); $google_client_id = ! empty( $settings['txtGoogleOAuthClientId'] ) ? $settings['txtGoogleOAuthClientId'] : ( $settings['txtOAuthClientId'] ?? '' ); $google_client_secret = ! empty( $settings['txtGoogleOAuthClientSecret'] ) ? $settings['txtGoogleOAuthClientSecret'] : ( $settings['txtOAuthClientSecret'] ?? '' ); $ms_client_id = ! empty( $settings['txtMsOAuthClientId'] ) ? $settings['txtMsOAuthClientId'] : ( 'microsoft' === $mailer ? ( $settings['txtOAuthClientId'] ?? '' ) : '' ); $ms_client_secret = ! empty( $settings['txtMsOAuthClientSecret'] ) ? $settings['txtMsOAuthClientSecret'] : ( 'microsoft' === $mailer ? ( $settings['txtOAuthClientSecret'] ?? '' ) : '' ); $has_google_token = ! empty( $settings['optOAuthRefreshToken_google'] ); $has_microsoft_token = ! empty( $settings['optOAuthRefreshToken_microsoft'] ); $google_email = sanitize_email( (string) ( $settings['optOAuthEmail_google'] ?? '' ) ); $microsoft_email = sanitize_email( (string) ( $settings['optOAuthEmail_microsoft'] ?? '' ) ); $configured_from = sanitize_email( (string) ( $settings['txtSmtpMail'] ?? '' ) ); $active_transport_label = 'smtp' === $mailer ? __( 'Other SMTP', 'aio-tools' ) : ( 'google' === $mailer ? __( 'Gmail API (HTTPS 443)', 'aio-tools' ) : __( 'Graph API (HTTPS 443)', 'aio-tools' ) ); $is_transport_ready = ( 'smtp' === $mailer && ! empty( $settings['txtSmtpHost'] ) ) || ( 'google' === $mailer && $has_google_token ) || ( 'microsoft' === $mailer && $has_microsoft_token ); $smtp_notice_key = 'aio_smtp_oauth_notice_' . get_current_user_id(); $smtp_oauth_alert = get_transient( $smtp_notice_key ); if ( false !== $smtp_oauth_alert ) { delete_transient( $smtp_notice_key ); } ?>
0 0

  1. "APIs & Services -> Library", search for "Gmail API" and click Enable.', 'aio-tools' ); ?>
  2. Create Credentials -> OAuth client ID (Web application)", add the Authorized Redirect URI above, then paste Client ID & Secret below.', 'aio-tools' ); ?>
  1. App registrations, create an app supporting Organizational & Personal Microsoft accounts.', 'aio-tools' ); ?>
  2. Add a permission -> Microsoft Graph -> Delegated", add Mail.Send, User.Read, and offline_access.', 'aio-tools' ); ?>