Hello Vitul,
As mentioned in this
article, in general Google Compute Engine does not allow outbound connections on ports 25, 465, and 587 but you can still set up your instance to send mail using partner services like
SendGrid,
Mailgun, or using Google Apps.
The other option is using
Gmail API which is a RESTful API and can be used to access Gmail mailboxes to send mail.
I hope this information helps.
Sincerely,
Kamran