When building an online store using WordPress + WooCommerce, the system automatically sends emails to users for order notifications, password resets, account registration, etc. Many website owners have found that these emails are received normally in domestic email providers (such as 163 and QQ Mail), but are easily flagged as unwanted emails if the user is using Gmail. SpamThis not only affects the user experience, but may also cause customers to miss important order notifications.

This article will guide you step-by-step through analyzing the causes of the problem and provide a complete solution, including... SMTP configurationDomain DNS Authentication (SPF/DKIM/DMARC) The specific operating steps.

Why does Gmail flag it as spam?

1. The method of sending emails is not standardized.

  • WordPress defaults to passing PHP mail() Alternatively, the server can use its built-in mail function to send emails.
  • Gmail detected the sender's email address (e.g., support@yourdomain.comIf the IP address does not match the actual sending server (website IP), it is considered suspicious.

2. Lack of SPF/DKIM/DMARC certification

  • Gmail verifies whether the domain has these three email verification mechanisms configured.
  • If it is not configured or is misconfigured, its reliability is low and it is likely to end up in the trash.

3. Send emails using a public email address

Public email addresses (such as) support@yourdomain.comThis is often used for sending mass notifications and carries a higher risk under Gmail's spam rules.

4. Poor server IP reputation

If the email is sent directly from the website server, the IP address may be blacklisted (e.g., by Backscatterer).

5. Email content is non-compliant.

Emails containing only images or sensitive words (such as "discount" or "limited time offer") are more likely to trigger spam rules.

Solution Approach

1. Use professional SMTP to send emails.

Install WP Mail SMTP This plugin allows all WordPress emails to be sent via Tencent Enterprise Email (or other professional email services).

Tencent Enterprise Email Configuration Example

  • Sender's email address:admin@yourdomain.com(We recommend using member email addresses; do not use public email addresses.)
  • SMTP server:smtp.exmail.qq.com
  • Port: 465 (SSL) or 587 (TLS)
  • Username: Full email address (e.g., ...) admin@yourdomain.com
  • Password: Generated in the Tencent Enterprise Email backend (https://exmail.qq.com/) SMTP authorization code

Emails sent in this way will appear as follows in Gmail:

mailed-by: exmail.qq.com
signed-by: yourdomain.com

Credibility has been significantly improved.

2. Configure DNS authentication for the domain name (SPF/DKIM/DMARC)

This is a crucial step in Gmail's process for determining the legitimacy of emails.

(1) Configure SPF

  1. Log in to your domain name resolution service provider's backend (Alibaba Cloud, Tencent Cloud, Cloudflare, etc.).
  2. Add a TXT record:
    • Host records:@
    • Record type:txt
    • Record value: v=spf1 include:spf.exmail.qq.com ~all
    • TTL: 600 seconds or default value

(2) Configure DKIM

  1. Log in to the Tencent Enterprise Email management backend → 【Domain Management】 → Select the domain → 【Set DKIM】.
  2. The system will generate a TXT record, in a similar format:
    • Host records:qcloud._domainkey
    • Record type:txt
    • Record value: v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFA...
  3. Go back to the domain name resolution backend and add the record.
  4. Save and wait for the DNS to take effect before using it. mail-tester.com Test to ensure DKIM = pass.

(3) Configure DMARC

  1. Log in to the domain name resolution backend and add a TXT record:
    • Host records:_dmarc
    • Record type:txt
    • Record value: v=DMARC1; p=none; rua=mailto:postmaster@yourdomain.com
    • illustrate:
      • p=none Indicates observation mode
      • rua Used to receive reports; you can replace it with your administrator email address.
  2. If everything goes smoothly afterward, you can... p=none Change to p=quarantine(Isolation) or p=reject(Refuse to accept), further enhancing anti-counterfeiting measures.

3. Optimize email content

  • Avoid using overly marketing headlines (such as "Limited Time Sale!!!").
  • Maintain a reasonable ratio between text and images.
  • Add company information, website address, and unsubscribe instructions at the bottom of the email to enhance its professionalism.

4. Testing and Verification

use mail-tester.com Test email scoring to ensure SPF/DKIM/DMARC all pass with a score of ≥ 8/10.

Click in Gmail inbox View the original email (Show original)The correct result should be:

mailed-by: exmail.qq.com
signed-by: yourdomain.com

If displayed mailed-by: yourdomain.comThis indicates that Tencent SMTP has not yet been used.

Summarize

The root cause of WordPress emails ending up in Gmail spam is... The email sending method and domain name authentication are not standardized..

✅ Solution approach:

  1. Use WP Mail SMTP to send emails via Tencent Enterprise Email;
  2. Configure SPF, DKIM, and DMARC authentication in DNS;
  3. Use member email addresses (e.g.) admin@yourdomain.com(as the sender);
  4. Optimize email subject lines and content.

After completing the above steps, the email will be sent through Tencent Enterprise Email's servers with a legitimate identity, greatly reducing the risk of Gmail classifying it as spam and ensuring that users do not miss any important notifications.