- Newest
- Most votes
- Most comments
Hello
Your design must be as Lambda => s3=> lambda => ses
BTW, you must consider using s3 pre signed url to allow the email destination access that covers file
Some references: https://docs.aws.amazon.com/AmazonS3/latest/userguide/NotificationHowTo.html
https://docs.aws.amazon.com/AmazonS3/latest/userguide/ShareObjectPreSignedURL.html
https://docs.aws.amazon.com/ses/latest/dg/send-email-raw.html
Wish that helps
From the lambda it may have not been allowed or blocked as an anti-spam measure, please check. You see a similar use case defined here https://aws.amazon.com/premiumsupport/knowledge-center/ec2-port-25-throttle/ . May be look into AWS Lambda to send email using Amazon Simple Email Service (Amazon SES), reference on how to configure can be found here https://aws.amazon.com/premiumsupport/knowledge-center/lambda-send-email-ses/
Relevant content
- asked 10 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 9 months ago
Hi Omid & Nitin,
Thanks for your response. I have completed DKIM settings and now able to send email from Lambda. But just wanted some guidance on sending attachments from S3:
def send_mail(subject,file): ses = boto3.client('ses') body = "<Mybody>" ses.send_email( Source = 'abc@xyz.com', Destination = { 'ToAddresses': [ 'recipient@gmail.com' ] }, Message = { 'Subject': { 'Data': subject, 'Charset': 'UTF-8' }, 'Body': { 'Text':{ 'Data': body, 'Charset': 'UTF-8' } } } )
Regards, dbeings