Using sendgrid or gmail smtp to send email from my website

What is the name of the domain?

https://bicig.afgdigitalcredit.com/

What is the error number?

Time out with error 504

What is the error message?

Gateway Time Out

What is the issue you’re encountering

Throwing gateway timeout error when connecting with SMTP HOST whether it is gmail or sendgrid

What steps have you taken to resolve the issue?

  1. Used Gmail smpt and updated DNS
  2. Tried Sendgrid with their API and updated DNS
  3. Created simple function which has only mail functionality just to test mail
    then also it is not working

Screenshot of the error

This 504 error is coming from your origin.

Contact your hosting provider to troubleshoot these common causes at your origin web server:

  • Ensure the origin server responds to requests for the hostname and domain within the visitor’s URL that generated the 502 or 504 error.
  • Investigate excessive server loads, crashes, or network failures.
  • Identify applications or services that timed out or were blocked.

You can read more at Troubleshooting Cloudflare 5XX errors · Cloudflare Support docs.