Sendmail和Postfix不从CentOS服务器发送邮件?

So I'm having some issues with the PHP mail function. I'm trying send users an email with a verification link. The thing is, it's not sending the email. I know for sure that the code is correct.

In the /var/log/maillog I can see a message saying:

'Feb 28 10:46:04 postfix/smtp[18038]: connect to gmail-smtp-in.l.google.com[74.125.136.26]:25: Connection timed out Feb 28 10:46:34 postfix/smtp[18038]: connect to alt1.gmail-smtp-in.l.google.com[74.125.130.26]:25: Connection timed out Feb 28 10:47:04 postfix/smtp[18038]: connect to alt2.gmail-smtp-in.l.google.com[64.233.189.26]:25: Connection timed out Feb 28 10:47:34 postfix/smtp[18038]: connect to alt3.gmail-smtp-in.l.google.com[173.194.72.26]:25: Connection timed out Feb 28 10:48:04 postfix/smtp[18038]: connect to alt4.gmail-smtp-in.l.google.com[74.125.25.26]:25: Connection timed out'

I'm pretty sure something is blocking the SMTP (25) from sending, I just don't know what it is.

Does anybody have a suggestion on what to do? What could be the issue?

P.S. SELinux is disabled.

Why are you runnning postfix and dovecot? You need a properly configured mail relay (postfix) to send email from your php server. Since you're already using gmail I would recommend this:

https://www.howtoforge.com/tutorial/configure-postfix-to-use-gmail-as-a-mail-relay/