def emailShows(newShows): subject = 'New Barby show%s posted!' % 's' if len(newShows) > 1 else '' body = '' for date, priceAndName in newShows.items(): price = priceAndName['price'] bandName = priceAndName['bandName'] body += f"{bandName}, {date} -- {price} Shekel \n" Mail.send_email(subject=subject, body=body)
from mail import Mail from getpass import getpass sender_id = input("Sender ID: ") sender_password = getpass(prompt="Sender Password: "******"Receiver ID: ") email_subject = input("Email Subject: ") email_content = input("Enter text content to be mailed") mailing.define_message(email_receiver, email_subject, email_content) mailing.send_email()