generate_qr_code(); $this->app_connected = get_option( 'post_smtp_mobile_app_connection' ); } } //Mobile App Notice if ( isset( $_GET['page'] ) && 'postman' === $_GET['page'] ) { if ( ! get_option( 'ps_dismissed_mobile_notice' ) ) { add_action( 'admin_notices', array( $this, 'mobile_app_notice' ) ); } } } /** * Enqueue scripts * * @since 2.7.0 * @version 1.0.0 */ public function admin_enqueue() { wp_enqueue_script( 'post-smtp-mobile', POST_SMTP_URL . '/Postman/Mobile/assets/js/admin.js', array( 'jquery' ), POST_SMTP_VER ); wp_enqueue_style( 'post-smtp-mobile', POST_SMTP_URL . '/Postman/Mobile/assets/css/admin.css', array(), POST_SMTP_VER ); } /** * Add menu * * @since 2.7.0 * @version 1.0.0 */ public function add_menu() { add_submenu_page( PostmanViewController::POSTMAN_MENU_SLUG, __( 'Mobile Application', 'post-smtp' ), sprintf( '%s%s', __( 'Mobile App', 'post-smtp' ), __( 'New', 'post-smtp' ) ), 'manage_options', admin_url( 'admin.php?page=postman/configuration#mobile-app' ), '', 3 ); } /** * Add tab * * @since 2.7.0 * @version 1.0.0 */ public function tabs( $tabs ) { $tabs['mobile-app'] = __( 'Mobile App', 'post-smtp' ); return $tabs; } /** * Generate QR code * * @since 2.7.0 * @version 1.0.0 */ public function generate_qr_code() { include_once 'includes/phpqrcode/qrlib.php'; $nonce = get_transient( 'post_smtp_auth_nonce' ); $authkey = $nonce ? $nonce : $this->generate_auth_key(); $site_title = get_bloginfo( 'name' ); set_transient( 'post_smtp_auth_nonce', $authkey, 1800 ); $endpoint = site_url( "?authkey={$authkey}&site_title={$site_title}" ); ob_start(); QRcode::png( urlencode_deep( $endpoint ) ); $result_qr_content_in_png = ob_get_contents(); ob_end_clean(); // PHPQRCode change the content-type into image/png... we change it again into html header("Content-type: text/html"); $this->qr_code = base64_encode( $result_qr_content_in_png ); } /** * Generate auth key * * @since 2.7.0 * @version 1.0.0 */ private function generate_auth_key() { $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; $chars .= '!@#$%^*()'; $chars .= '-_ []{}<>~`+,.;:/|'; $pass = array(); //remember to declare $pass as an array $alphaLength = strlen( $chars ) - 1; //put the length -1 in cache for ( $i = 0; $i < 32; $i++ ) { $n = rand( 0, $alphaLength ); $pass[] = $chars[$n]; } return implode( $pass ); //turn the array into a string } /** * Section * * @since 2.7.0 * @version 1.0.0 */ public function section() { //Incompatible server if( function_exists( 'ImageCreate' ) ): ?>

Download Post SMTP Mobile Application

  1. Open Post SMTP mobile app 📱 on your android or iOS device.
  2. Tap on Scan QR Code button to link your mobile device with Post SMTP plugin.
  3. Point your mobile device to this screen to capture the QR Code.

And you are done👍.

Want more details? Check out our complete guide Post SMTP Plugin with Mobile App

app_connected ) { echo ''; ?>
Connected Device: "; foreach( $this->app_connected as $device ) { $url = admin_url( "admin.php?action=post_smtp_disconnect_app&auth_token={$device['fcm_token']}" ); $checked = $device['enable_notification'] == 1 ? 'checked="checked"' : ''; echo "{$device['device']} Disconnect"; echo '
'; echo sprintf( '', __( 'Send failed email notification' ), $device['fcm_token'], $checked ); } } ?>

%s', __( 'Your server does not have GD Library Installed/ Enabled, talk to your host provider to enable to enjoy Post SMTP Mobile Application', 'post-smtp' ), esc_url( 'https://www.php.net/manual/en/image.installation.php' ), __( 'learn more.', 'post-smtp' ) ) ?>
$device ) { if( in_array( $device['fcm_token'], $devices ) ) { $connected_devices[$key]['enable_notification'] = 1; } else { $connected_devices[$key]['enable_notification'] = 0; } } } update_option( 'post_smtp_mobile_app_connection', $connected_devices ); return $input; } /** * Disconnects the mobile application :( * * @since 2.7.0 * @version 1.0.0 */ public function disconnect_app() { if( isset( $_GET['action'] ) && $_GET['action'] == 'post_smtp_disconnect_app' ) { $connected_devices = get_option( 'post_smtp_mobile_app_connection' ); $auth_token = $_GET['auth_token']; $server_url = get_option( 'post_smtp_server_url' ); if( $connected_devices && isset( $connected_devices[$auth_token] ) ) { $device = $connected_devices[$auth_token]; $auth_key = $device['auth_key']; $response = wp_remote_post( "{$server_url}/disconnect-app", array( 'method' => 'PUT', 'headers' => array( 'Content-Type' => 'application/json', 'Auth-Key' => $auth_key, 'FCM-Token' => $auth_token ) ) ); $response_code = wp_remote_retrieve_response_code( $response ); if( $response_code == 200 ) { delete_option( 'post_smtp_mobile_app_connection' ); delete_option( 'post_smtp_server_url' ); } } wp_redirect( admin_url( 'admin.php?page=postman/configuration#mobile-app' ) ); } } /** * Shows mobile app notice | Action Call-back * * @since 2.7.1 * @version 1.0.0 */ public function mobile_app_notice() { ?>

Easy Email Tracking Quickly View Error Details
Get Instant Failure Notifications Get Email Preview
Resend Failed Emails Support For Multiple Sites (Coming Soon)
Learn More