SMTP notifications refused by Gmail

Hello,
I’m trying to get email notifications working on my HA server.
The basic configurations seems to be fine - emails are sending correctly to my spare email address with web hosting service. However my default email that I daily use is a Gmail and here I would like to recive my notifications.
When I try to send mail to my gmail address HA seems to send it fine, but email is not delivered and in smtp logs I’m seeing following errors:

2025-05-30 07:48:31 1uKsbX-0000000BFXk-3r1N <= [email protected] H=(some_numbers-music-assistant.local.hass.io) [MY_IP_ADDRESS] P=esmtpsa X=TLS1.2:ECDHE-ECDSA-AES128-GCM-SHA256:128 CV=no A=plain:[email protected] S=845 id=some_id@some_numbers-music-assistant.local.hass.io T="Test SMTP z home assistant" from <[email protected]> for [email protected]
2025-05-30 07:48:32 1uKsbX-0000000BFXk-3r1N ** [email protected] F=<[email protected]> R=lookuphost T=remote_smtp H=gmail-smtp-in.l.google.com [142.251.9.26] X=TLS1.2:ECDHE-ECDSA-AES128-GCM-SHA256:128 CV=yes: SMTP error from remote mail server after end of data: 550-5.7.1 [MY_SMTP_IP] Messages missing a valid address in From: header, or\n550-5.7.1 having no From: header, are not accepted. For more information, go to\n550-5.7.1  https://support.google.com/mail/?p=RfcMessageNonCompliant and review\n550 5.7.1 RFC 5322 specifications. 4fb4d7f45d1cf-6056711281csi1124546a12.284 - gsmtp

My configuration:

notify:
  - name: email_alert
    platform: smtp
    server: server.address.pl
    port: 465
    timeout: 15
    sender: "[email protected]"
    sender_name: "Szrank - Home Assistant"
    encryption: tls
    username: "[email protected]"
    password: "mypass"
    recipient:
      - "[email protected]"

What can cause the issue?

HA version is 2025.5.3
Music Assistant (because it is showing in smtp logs) is installed as addon

is [email protected] a valid email address ?

Sure it is. As I mentioned, mails are sent correctly to my spare email address with web hosting service. The only issue is when I try to email to @gmail.com

DMARC, SPF and DKIM all correct for your server ? gmail is picky about these.

I have similar setup and it works fine. I just tested again and got the email delivered to my Gmail account. Please see the differences in your setup and mine. There are couple of subtle ones. Not sure if they are making any difference:

notify:
  - name: "email_alert"
    platform: smtp
    server: "<SMTP server name>"
    port: 587
    timeout: 15
    sender: "[email protected]"
    encryption: starttls
    username: "<username for SMTP authentication>"
    password: "<password for SMTP authentication>"
    recipient:
      - "[email protected]"