Code: import requests import json import boto3 def lambda_handler(event, context): city_name="Orlando" api_key="****************" url="api.openweathermap.org/data/2.5/weather?q="+city_name+"&appid="+api_key+"&units=metric" print("URL for API: ",url) result=requests.get(url) data_extracted=result.json() temp_orlando=data_extracted['main']['temp'] subject = 'Temperature Information of Orlando' client = boto3.client("ses") body = """ This mail comes from AWS Lambda Event Scheduling. Current temperature of Orlando is {} . """.format(temp_orlando) message = {"Subject": {"Data": subject}, "Body": {"Html": {"Data": body}}} response = client.send_email(Source = "****************", Destination = {"ToAddresses": ["****************"]}, Message = message) print("The mail is sent successfully")