RU Русская версия

OpenCart email through Yandex 360 and Mail.ru

How to send the store’s email through your domain’s email provider, so that order notifications reach customers and pass SPF, DKIM, and DMARC checks.

  • 5 stepsguide
  • 7 minread

Published by Sergey Polyakov

By default, OpenCart sends email with the PHP mail() function directly from the hosting server. That server’s address is not in your domain’s SPF record, and the messages have no DKIM signature. Mailbox providers treat such messages as suspicious: order notifications land in spam or never arrive, and DMARC reports show rows with a fail result.

The fix is to send the store’s email through the SMTP server of your domain’s email provider and publish SPF, DKIM, and DMARC records for the domain. Below are the steps for Yandex 360 and for Mail.ru (VK WorkSpace), the two business email providers most used in Russia. The steps are the same; the server address, where you create the password, and the DNS record values differ. The same approach works with any other email provider that offers SMTP.

The guide uses placeholder data:

WhatExample
Site domainexample-shop.ru
Mailbox the site sends frominfo@example-shop.ru
Domain email providerYandex 360 for Business or Mail.ru for Business (VK WorkSpace)
Store platformOpenCart 3 or LiveStore 3
Before you start

The info@example-shop.ru mailbox must already exist with your domain’s email provider. We explain how to connect Yandex 360 to a domain in our guide to email on your domain.

1. Create an app password

The regular mailbox password does not work for sending from a site: both Yandex and Mail.ru accept only a separate app password over SMTP. Create it while signed in to the mailbox the site will send from.

Yandex 360

  1. Sign in to Yandex as info@example-shop.ru and open the Security tab in Yandex ID settings.
  2. In the section on access to your data, choose App passwords.
  3. Choose the Mail app type, enter a name such as “example-shop.ru website”, and click Next.
  4. Copy the password. It is shown only once: if the window closes, delete this password and create a new one.

The password does not work right away; according to Yandex documentation, it takes 2⁠–⁠3 hours. In the email clients section of Yandex Mail settings, check that app passwords and OAuth tokens are enabled.

Mail.ru (VK WorkSpace)

  1. Sign in to the mailbox info@example-shop.ru.
  2. Open Settings → All settings → Security → Passwords for external apps and click Add.
  3. Enter a name such as “example-shop.ru website” and save.
  4. Copy the password. Mail.ru does not store it: if you lose it, create a new one.

A phone number must be linked to the mailbox to create the password. If there is no option for external app passwords, ask the domain administrator in VK WorkSpace to allow the mailbox access from external email clients.

2. Enable SMTP in OpenCart

The site must send email through the email provider’s SMTP server, signed in as the same mailbox that is set as the store’s address.

  1. Sign in to the site admin panel: example-shop.ru/admin.
  2. Open System → Settings and click the Edit button (pencil) next to your store.
  3. On the Store tab, enter info@example-shop.ru in the E-Mail field. It must match the SMTP username, or the mail server will reject the message.
  4. Go to the Mail tab and fill in the fields from the table.
  5. Click Save in the top right corner.
FieldYandex 360Mail.ru (VK WorkSpace)
Mail EngineSMTPSMTP
Mail Parametersleave emptyleave empty
SMTP Hostnamessl://smtp.yandex.russl://smtp.mail.ru
SMTP Usernameinfo@example-shop.ruinfo@example-shop.ru
SMTP Passwordthe app password from step 1the app password from step 1
SMTP Port465465
SMTP Timeout1515

The ssl:// prefix before the server address is required for port 465: without it, OpenCart will not open a secure connection. The default 5⁠-⁠second timeout is often too short, and the OpenCart documentation recommends raising it to 10⁠–⁠15 seconds.

The same tab has an Additional Alert Mail field. Make sure it lists the store’s working addresses, not developers’ test addresses.

If the site has third-party form extensions (callback request, quick order, newsletters), check their settings: some of them send mail their own way, bypassing the OpenCart settings.

3. Add SPF, DKIM, and DMARC records

Records are added wherever the domain’s DNS is managed: at the registrar, or at the hosting provider if the domain is delegated to its name servers. Look for a section called DNS records, DNS editor, or zone management. If the domain is delegated to Yandex servers, the SPF and DKIM records for Yandex 360 are created automatically, and you only need to add DMARC.

TypeName (host)Yandex 360Mail.ru (VK WorkSpace)
TXT@v=spf1 redirect=_spf.yandex.netv=spf1 redirect=_spf.mail.ru
TXTDKIMname mail._domainkey, value from the Yandex 360 admin panelname and value from the VK WorkSpace admin panel
TXT_dmarcv=DMARC1; p=none; rua=mailto:info@example-shop.ru

SPF

A domain must have exactly one record starting with v=spf1. If one already exists, do not add a second one; merge them. The redirect modifier cannot be combined with other sources, so for several services use include, for example v=spf1 include:_spf.yandex.net include:<another service> ~all. There is no need to add the hosting server’s address, since the site now sends mail through the email provider.

Some panels do not accept @ in the name field: in that case, enter the full domain (example-shop.ru.) or leave the field empty.

DKIM

In Yandex 360, open Domains in the organization admin panel, click the DKIM setup button next to the domain, and copy the public key. It starts with v=DKIM1; k=rsa;. The record name is mail._domainkey; some panels need the full name mail._domainkey.example-shop.ru.

In VK WorkSpace, the record value is in the admin panel, in the domain management section under MX and SPF setup. Copy the DKIM record name and value from there unchanged.

DMARC

Start with the p=none policy: messages are not blocked, and the address in rua receives reports on which servers send email on behalf of your domain and whether they pass the checks. We will tighten the policy in step 5.

DNS changes do not take effect immediately: according to Yandex documentation, it can take up to 72 hours. In Yandex 360, the record status updates with the Check button on the Domains page.

4. Test an email from the site

The setup is done when an email from the site passes all three checks.

  1. Send an email from the site to an external mailbox (Gmail is the most convenient): a password reset, the contact form, or a test order.
  2. In Gmail, open the message and click More (three dots) → Show original.
  3. At the top you should see SPF: PASS, DKIM: PASS, DMARC: PASS, and your domain example-shop.ru in the sender address.

If the email did not arrive or a check failed, find the symptom in the table below.

5. Tighten the DMARC policy

Watch the DMARC reports for one or two weeks. Rows with your real messages should show spf pass and dkim pass. Rows from unfamiliar addresses with a fail result are messages spoofing your domain, and those are what you want to cut off.

  1. Change the _dmarc record to v=DMARC1; p=quarantine; rua=mailto:info@example-shop.ru: spoofed messages will go to spam.
  2. If there are no problems after another week or two, set p=reject: spoofed messages will be rejected.
Important

Do not set p=reject until email from the site passes the checks. Otherwise customers will stop receiving order notifications.

Common errors

What you seeCauseWhat to do
Error 535, “Authentication failed”The regular mailbox password was used, or the app password is not active yetEnter the app password from step 1; with Yandex, wait 2⁠–⁠3 hours after creating it
“Could not connect”, a timeout errorNo ssl:// prefix, the timeout is too short, or the hosting provider blocks outbound port 465Check the server address and timeout; try tls:// with port 587, or ask the hosting provider to open the port
Error 550 or 553 about the senderThe store email does not match the SMTP usernameSet the store E-Mail to the same address as the SMTP username
SPF still failsThe domain has two SPF records, or DNS has not updated yetKeep a single v=spf1 record and wait up to 72 hours
DKIM failsThe DKIM record was not added or was copied with a mistakeCompare the name and value with the Yandex 360 or VK WorkSpace admin panel
Some emails from the site fail the checksA third-party extension sends mail through mail()Switch the extension to SMTP or replace it
Reports show fail from unfamiliar addressesSomeone is spoofing your domainThis is not a setup error: move to p=quarantine, then to p=reject

Sources

  1. App passwords, Yandex ID Help (in Russian).
  2. Setting up email clients: SMTP settings, Yandex Mail Help (in Russian).
  3. SPF record, Yandex 360 for Business Help (in Russian).
  4. DKIM signature, Yandex 360 for Business Help (in Russian).
  5. Setting up email clients: SMTP and external app passwords, Mail.ru Help (in Russian).
  6. Setting up an SPF record, VK WorkSpace documentation (in Russian).
  7. Setting up a DKIM signature, VK WorkSpace documentation (in Russian).
  8. Mail settings, OpenCart documentation.
  9. RFC 7208: Sender Policy Framework (SPF), IETF.
  10. RFC 7489: Domain-based Message Authentication, Reporting, and Conformance (DMARC), IETF.
  11. Trace an email with its full headers, Gmail Help.

More articles

Step-by-step guides: domain, hosting, email, maps, and MODX setup.

All articles

Let’s talk

Need help with your site’s email? Contact us, and we will set up sending through your domain’s email provider and check SPF, DKIM, and DMARC.

  • Emailinfo@studiops.ru
  • Messaging app
  • OfficeBalashikha, Moscow Region, Russia
    Mon–Fri, 8 a.m.–5 p.m. Moscow time (UTC+3)
What can we help with?