I am using a third party app in google container engine. It expects SMTP to be configured on default port(25) of localhost.
Since I cannot configure SMTP URL for the application and google cloud doesn't allow usage of SMTP ports, is there any way by which I can send emails from GKE.
To send email from GCP, you first need to create an account. Once you have an account, you can create an email address and set up your GCP account to use that address for email. You can also use your GCP account to access your email messages in the Gmail web interface or through the Google Cloud Platform Console.
Yes! You can use the SMTP server even if you've enabled two-factor authentication on your Google account. However, you will need to generate an app password so that the app can still connect.
If you are using Kubernetes, you can send mails by adding a sidekick Emailrelay container to your pod.
Emailrelay can run as-a-proxy. It listens on port 25 of localhost and forwards mails to an external SMTP server. It also supports authentication with outbound server and STARTTLS. Sample command will be like
emailrelay --no-daemon --as-proxy external.smtp.server:<PORT> --client-tls --client-auth /path/to/smtp/auth
Credentials file needs to be in format
LOGIN client username password
where, 'username' and 'password' should to be xtext encoded.
To overcome google cloud limitations, external server needs to accept SMTP requests on custom port.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With