trying to scan to email on my officejet pro 9125e and it keeps failing, says 'cannot connect to server'.

— asked by Taylor

Quick answer: The "cannot connect to server" error on the HP OfficeJet Pro 9125e is almost always a handshake failure between the printer's internal firmware and the Outgoing Mail Server (SMTP). This happens because modern email providers (Gmail, Outlook, Yahoo) have deprecated "Less Secure Apps" and basic password authentication in favor of OAuth2 or App-Specific Passwords.

Diagnosis

The "cannot connect to server" error on the HP OfficeJet Pro 9125e is almost always a handshake failure between the printer's internal firmware and the Outgoing Mail Server (SMTP). This happens because modern email providers (Gmail, Outlook, Yahoo) have deprecated "Less Secure Apps" and basic password authentication in favor of OAuth2 or App-Specific Passwords. The printer, which relies on a static SMTP configuration, cannot perform a modern web-based login, leading the server to reject the connection attempt immediately. To confirm this is a server authentication issue rather than a network failure, check the printer's Wi-Fi status. If the printer can print from your computer but cannot scan to email, the network hardware is fine, and the problem lies specifically in the SMTP port configuration or the account's security permissions. Specifically, if you are using port 25, most ISPs block this to prevent spam, which triggers this exact error message.

How to Fix It

To resolve this, you must bypass standard password authentication and configure the printer with a dedicated App Password.

  1. Generate an App Password: Do not use your primary email password. Log into your email account via a web browser, go to Security Settings, enable Two-Factor Authentication (2FA), and select "App Passwords." Generate a password specifically for "Other (Custom name)" and label it "HP Printer." Copy the 16-character code provided.
  2. Access the Embedded Web Server (EWS): Instead of using the small printer screen, find the printer's IP address (found under Network Summary on the control panel). Type this IP address into a web browser on your computer to open the EWS page.
  3. Navigate to Scan Settings: Click the "Scan" tab at the top of the page, then select "Scan to Email" from the left-hand sidebar.
  4. Configure SMTP Settings:
    • SMTP Server: For Gmail, enter smtp.gmail.com; for Outlook/Hotmail, enter smtp-mail.outlook.com.
    • Port: Change this to 587.
    • SSL/TLS: Check the box for "TLS" or "SSL/TLS."
    • Authentication: Select "Always" or "On."
    • Username: Enter your full email address (e.g., [email protected]).
    • Password: Enter the 16-character App Password you generated in Step 1.
  5. Save and Test: Click "Apply" or "Save." Use the "Test" button within the EWS interface to send a verification email. If the test passes, the printer screen will no longer show the connection error.

If That Didn't Work

  • DNS Server Override: The printer may be failing to resolve the SMTP address. In the EWS "Network" tab, go to "IPv4 Configuration" and change the DNS setting from "Automatic" to "Manual." Set the Primary DNS to 8.8.8.8 and the Secondary DNS to 8.8.4.4 (Google's Public DNS). This ensures the printer can find the mail server.
  • Disable Firewall Blocking: Some security software (like Norton or McAfee) or router firewalls block port 587. Temporarily disable your PC's firewall or check your router's "Port Forwarding" settings to ensure outbound traffic on port 587 is permitted.
  • Switch to Port 465: Some network environments block 587 but allow 465. In the SMTP settings, change the port to 465 and ensure "SSL" is checked. This uses a different encryption tunnel that may bypass local network restrictions.
  • Firmware Update: If the printer is running an early version of the 9125e firmware, it may have a bug in its TLS handshake. Go to "Settings" > "Printer Maintenance" > "Update Firmware" on the control panel to ensure the latest security patches are installed.

Heads Up

  • Avoid Port 25: Never use Port 25 for scan-to-email; it is almost universally blocked by home and business ISPs to prevent botnets from sending spam.
  • Password Changes: If you ever change your primary email password, you must delete the old App Password and generate a new one for the printer, or the connection will break immediately.
  • Static IP: Assign a Static IP to your printer in the EWS settings. This prevents the printer from losing its connection to the server if the router re-assigns a new IP address via DHCP.
  • Email Limits: Be aware that free email accounts have daily sending limits. If you scan 100+ large documents a day, your provider may temporarily flag the printer as a spam source.

📖 HP Printer Troubleshooting Guide - Fix Any Printing Problem
0

Different problem with the same product?

Ask about the HP OfficeJet Pro 9125e All-in-One Printer →