Skip to content

AppRunner Network Connectivity and Security Group to work with resend (email service)

0

I run to the issue with sending emails from AWS App Runner using the Resend.com service. The emails are working fine when I run my application locally in a Docker container, but after deploying to App Runner, no emails are being sent and there are no logs on the Resend.com side. Please help to troubleshoot with steps to identify and resolve this issue.

1 Answer
0

Hello.

Are you trying to send email using port 25?
AWS restricts port 25, so please apply to remove the restriction or use a mail sending port other than port 25.
https://repost.aws/knowledge-center/ec2-port-25-throttle

If the problem is not the port number, could you please provide the error log of the container application?

You may also want to consider sending emails using Amazon SES.
https://docs.aws.amazon.com/ses/latest/dg/send-email.html

EXPERT

answered a year ago

AWS
EXPERT

reviewed a year ago

  • Thank you for your answer, I read posts you linked here, I understand that Port 25 no longer can be used . So, switched to SMTP ,

    Here is my nodemailer settings:

    const transporter = nodemailer.createTransport({
                host: process.env.EMAIL_HOST || 'smtp.resend.com',
                secureConnection: false, // TLS requires secureConnection to be false
    
                port: process.env.EMAIL_PORT || 2587,
                auth: {
                  user: process.env.EMAIL_TRANSPORTER_USER,
                  pass: process.env.EMAIL_TRANSPORTER_PASSWORD,
                },
                tls: {
                  ciphers:'SSLv3'
                },
    });
    

    Tried all ports posted on resend site for SMTP: Send emails using SMTP instead of the REST API.

    See documentation for more information.

    Host smtp.resend.com

    Port 465 For encrypted/TLS connections use 2465, 487, 2587 and still getting errors, see bellow

    `Here is my logs:
    2025-02-08T18:40:32.605-06:00 Error: Connection timeout 2025-02-08T18:40:32.605-06:00 at SMTPConnection._formatError (/app/node_modules/nodemailer/lib/smtp-connection/index.js:809:19) 2025-02-08T18:40:32.605-06:00 at SMTPConnection._onError (/app/node_modules/nodemailer/lib/smtp-connection/index.js:795:20) 2025-02-08T18:40:32.605-06:00 at Timeout.<anonymous> (/app/node_modules/nodemailer/lib/smtp-connection/index.js:237:22) 2025-02-08T18:40:32.605-06:00 at listOnTimeout (node:internal/timers:581:17) 2025-02-08T18:40:32.605-06:00 at process.processTimers (node:internal/ti

  • And one more notes, I tested all ports on local and they works for sending emails, so there is something blocking on AWS

  • Is your AppRunner connected to a custom VPC? In that case, you will not be able to access external services from AppRunner unless you set up a NAT Gateway. https://aws.amazon.com/jp/blogs/containers/deep-dive-on-aws-app-runner-vpc-networking/

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.