Why Gateways are used during mail transfer?
Email using SMTP effort best while both the sender and the receiver are on the internet and can hold TCP connections in between sender and receiver.
Nonetheless many machines which are not on the internet still need to send and receive email by internet sites. For illustration many companies intentionally eliminate themselves for security purposes.
The other problem occurs while the sender and receiver speak various protocols therefore direct communication is not possible.
Both of such problems are solved by using application layer email gateways.