Code: import json import boto3 def lambda_handler(event, context): file_name = event['Records'][0]['s3']['object']['key'] bucketName=event['Records'][0]['s3']['bucket']['name'] print("Event details : ",event) print("File Name : ",file_name) print("Bucket Name : ",bucketName) subject = 'Event from ' + bucketName client = boto3.client("ses") body = """
This is a notification mail to inform you regarding s3 event. The file {} is inserted in the {} bucket . """.format(file_name, bucketName) message = {"Subject": {"Data": subject}, "Body": {"Html": {"Data": body}}} response = client.send_email(Source = "Put the sender's mail id", Destination = {"ToAddresses": ["Put Destination Mail id"]}, Message = message) print("The mail is sent successfully")
Hi, thanks for this video, it actually very helpful on something I am currently trying my hands on, are you able to help with how I can use the same process to send bulk email?
@@akinadewole696 sorry for the late reply , but if you are still looking for solution , then simply call the SendEmail API repeatedly for each email you would like to send or else you can use AWS Pinpoint service 😊 Here is a detail demo on sending multiple mails using this very popular service widely used for marketing -- ua-cam.com/video/gwYhfwKNrbs/v-deo.html Happy Learning
Hello AnIvEsH , sorry for the late reply , but if you are still looking for solution , then yes , it's possible to send mail without verifying the recipients in amazon ses . Your SES account is in Sandbox Mode. You need to open a request with AWS to take your SES account out of Sandbox Mode. You can follow this documentation to raise request -- docs.aws.amazon.com/ses/latest/dg/request-production-access.html Here I demonstrated how to send mail without verifying the destination mail address using AWS Pinpoint -- ua-cam.com/video/gwYhfwKNrbs/v-deo.html Hope this will be helpful ! Happy Learning
Very nice, well explained, the beauty is in the clear and simple instructions without missing any steps, and you created everthing from scratch very nicely. Thanks
Thank you for your feedback Neeraj! I'm glad you found the video helpful. I'll definitely keep posting more videos like this in the future. Stay tuned!
yes , if your SES account is in Sandbox Mode. If you want to send mail without verifying the recipients in amazon ses , then need to open a request with AWS to take your SES account out of Sandbox Mode. You can follow this documentation to raise request -- docs.aws.amazon.com/ses/latest/dg/request-production-access.html Here I demonstrated how to send mail without verifying the destination mail address using AWS Pinpoint -- ua-cam.com/video/gwYhfwKNrbs/v-deo.html Hope this will be helpful ! Happy Learning
Hello uppala adarsh, I work with Python & PySpark , left working with Java long back , so don't have any video on Java with SES , but you can refer this documentation which contain all codes on SES Java Integration -- docs.aws.amazon.com/code-samples/latest/catalog/code-catalog-javav2-example_code-ses.html Hope this will be helpful! Happy Learning
Hi, thanks for this video, it actually very helpful on something I am currently trying my hands on, are you able to help with how I can use the same process to send bulk email?
Hello Akinjide Adewole , sorry for the late reply , but if you are still looking for solution , then simply call the SendEmail API repeatedly for each email you would like to send or else you can use AWS Pinpoint service 😊 Here is a detail demo on sending multiple mails using this very popular service widely used for marketing -- ua-cam.com/video/gwYhfwKNrbs/v-deo.html Happy Learning
Hi, i have a question. Is there any way for me to sent mail to many addresses without the recipient notice that I sent the email to many people in a time ?
@@lalithavarma5973 KeyError exception is what is raised when you try to access a key that isn’t in a dictionary (dict). Check whether in cloudwatch logs the filename , bucket name etc. are getting printed properly or not ... if required add an extra print statement before file_name = event['Records'][0]['s3']['object']['key'] line and print the event for which the Lambda is getting triggered , that will help you in debugging ...
Code:
import json
import boto3
def lambda_handler(event, context):
file_name = event['Records'][0]['s3']['object']['key']
bucketName=event['Records'][0]['s3']['bucket']['name']
print("Event details : ",event)
print("File Name : ",file_name)
print("Bucket Name : ",bucketName)
subject = 'Event from ' + bucketName
client = boto3.client("ses")
body = """
This is a notification mail to inform you regarding s3 event.
The file {} is inserted in the {} bucket .
""".format(file_name, bucketName)
message = {"Subject": {"Data": subject}, "Body": {"Html": {"Data": body}}}
response = client.send_email(Source = "Put the sender's mail id", Destination = {"ToAddresses": ["Put Destination Mail id"]}, Message = message)
print("The mail is sent successfully")
Hi, thanks for this video, it actually very helpful on something I am currently trying my hands on, are you able to help with how I can use the same process to send bulk email?
@@akinadewole696 sorry for the late reply , but if you are still looking for solution , then simply call the SendEmail API repeatedly for each email you would like to send or else you can use AWS Pinpoint service 😊 Here is a detail demo on sending multiple mails using this very popular service widely used for marketing -- ua-cam.com/video/gwYhfwKNrbs/v-deo.html
Happy Learning
Thanks brother.. simply outstanding.well explained
Thanks and welcome
Nice work Satadru
Thank you @chattorajchattoraj4829! Happy Learning
its really helpful and simple content. Thanks
Thank You Sunil Madekar! Happy Learning
Thank you so much✌️
You are Welcome Rajshree Sahu! Happy Learning :-)
Have any other process if i dont verify the reciver mail to send the mail
Hello AnIvEsH , sorry for the late reply , but if you are still looking for solution , then yes , it's possible to send mail without verifying the recipients in amazon ses . Your SES account is in Sandbox Mode. You need to open a request with AWS to take your SES account out of Sandbox Mode. You can follow this documentation to raise request -- docs.aws.amazon.com/ses/latest/dg/request-production-access.html
Here I demonstrated how to send mail without verifying the destination mail address using AWS Pinpoint -- ua-cam.com/video/gwYhfwKNrbs/v-deo.html
Hope this will be helpful ! Happy Learning
Thank you
You are welcome @DevOpsPulse! Happy Learning
Thank you for video, very infomative and the code is very useful to start a SES project
Glad to know the video is helpful to you Hong Cai! Happy Learning
Very nice, well explained, the beauty is in the clear and simple instructions without missing any steps, and you created everthing from scratch very nicely. Thanks
Thank you so much Hamid S🙂 Happy Learning :-)
thanks for sharing easy and clean method
Most welcome Vikas kumar😊Happy Learning :-)
@@KnowledgeAmplifier1 please start complete series devos
Thank you very much, very much needed video..!!!!!!!!
Glad it was helpful Padmanabh Kale! Happy Learning :-)
@@KnowledgeAmplifier1 could you please let me know how to integrate it with Amazon connect
very well explained. keep posting these kind of video
Thank you for your feedback Neeraj! I'm glad you found the video helpful. I'll definitely keep posting more videos like this in the future. Stay tuned!
the destination email needs to be verified ??
yes , if your SES account is in Sandbox Mode. If you want to send mail without verifying the recipients in amazon ses , then need to open a request with AWS to take your SES account out of Sandbox Mode. You can follow this documentation to raise request -- docs.aws.amazon.com/ses/latest/dg/request-production-access.html
Here I demonstrated how to send mail without verifying the destination mail address using AWS Pinpoint -- ua-cam.com/video/gwYhfwKNrbs/v-deo.html
Hope this will be helpful ! Happy Learning
Hi I have a requirement
Calling SES email from Java lambda which is vpc
Can you please help me..
Hello uppala adarsh, I work with Python & PySpark , left working with Java long back , so don't have any video on Java with SES , but you can refer this documentation which contain all codes on SES Java Integration -- docs.aws.amazon.com/code-samples/latest/catalog/code-catalog-javav2-example_code-ses.html
Hope this will be helpful! Happy Learning
Hi, thanks for this video, it actually very helpful on something I am currently trying my hands on, are you able to help with how I can use the same process to send bulk email?
Hello Akinjide Adewole , sorry for the late reply , but if you are still looking for solution , then simply call the SendEmail API repeatedly for each email you would like to send or else you can use AWS Pinpoint service 😊 Here is a detail demo on sending multiple mails using this very popular service widely used for marketing -- ua-cam.com/video/gwYhfwKNrbs/v-deo.html
Happy Learning
Can we send any other method without using domain
I am getting param validation error
Hi, i have a question. Is there any way for me to sent mail to many addresses without the recipient notice that I sent the email to many people in a time ?
It is showing an error in the lambda function code can you please send the correct code
Kamisetty Lakshmi chaitrika I sent the same code which I used in the video 😅Can you please let me know what error are you getting ?
We are getting errormeassage: "records" ,
"ErrorType": "keyError",
@@lalithavarma5973 KeyError exception is what is raised when you try to access a key that isn’t in a dictionary (dict). Check whether in cloudwatch logs the filename , bucket name etc. are getting printed properly or not ... if required add an extra print statement before file_name = event['Records'][0]['s3']['object']['key'] line and print the event for which the Lambda is getting triggered , that will help you in debugging ...
Can you provide the exact print statement which needs to be added. I am also facing the same error.
Hi, Thanks for this awesome video..
Could pls share a java code for this instead of python...??
Currently no saru latha , I mostly work in Python Language ! You can check in Google.. Happy Learning :-)