As of April 2024, Gmail has drastically increased enforcement of their requirement for all senders to use SPF and DKIM authentication.
If this is impacting you then you may receive a delivery failure (bounce message) that looks like one of these (highlighting added for emphasis):
john.doe@gmail.com: host gmail-smtp-in.l.google.com[142.251.116.26] said:
550-5.7.26 This mail has been blocked because the sender is unauthenticated.
550-5.7.26 Gmail requires all senders to authenticate with either SPF or DKIM.
550-5.7.26 Authentication results:
550-5.7.26 DKIM = did not pass
550-5.7.26 SPF [mailserver.example.com] with ip: [216.172.106.39] = did not pass
550-5.7.26 For instructions on setting up authentication, go to
550 5.7.26 https://support.google.com/mail/answer/81126#authentication
john.doe@gmail.com: host gmail-smtp-in.l.google.com[xxx.xxx.xxx.xxx] said:
550-5.7.1 [xxx.xxx.xxxx.xxx] Our system has detected that this message is
550-5.7.1 likely unsolicited mail. To reduce the amount of spam sent to Gmail,
550-5.7.1 this message has been blocked. Please visit
550-5.7.1 https://support.google.com/mail/?p=UnsolicitedMessageError
550 5.7.1 for more information.
These errors indicate that you probably need to enable SPF
and DKIM
for your domain.
See: How do I enable SPF and DKIM for emails sent from my domain?