Sending mail to external server

Hello.

I have a mailserver on my machine. If I want to send mail to a gmail account, do I have to send to Gmail smtp on port 25 ?

Or can servers communicate on different ports than 25 for this purpose?

Best regards
Neo

servers can communicate on any mutually agreed upon receiving port.

In this case, since you’re the sending server, you must send it to the port that the receiving server is expecting it on.

“In this case, since you’re the sending server, you must send it to the port that the receiving server is expecting it on.”

That would be 25 as standard?

I believe they are using the standard port 25, yes.

According to this article they don’t use port 25. You should use 465 instead, with TLS enabled.

Although, if you have a mailserver running on your machine it should be its job to figure out where to send emails to, you should not have to tell it. Unless I read your question wrong and you want to configure your mailserver to use Gmail as a relay to send outgoing emails?

That’s the outbound SMTP server, not the inbound MX connection though?

Google shouldnt really be using 465 either, but… Google. shrug

EDIT: That said, i’m not sure why a MX would need to know a port for a specific mail server recipient, it should be negotiatable between servers as part of the server software…

Yes, I think it is used if I am going to send mail (as client) from my gmail account to another account. Then I can use their smtp in that way instead of logging into my gmail account on gmail.com

The negotiation must start at some port right? :slight_smile:

25 seems to work well