I am using the following:
:::python
import smtplib
def my_Mailer():
sender_email = 'xxxx@gmail.com'
receiver_email = 'yyyy@gmail.com'
cc_email = 'zzzz@gmail.com'
password = 'myapppassword'# Create Email
from email.message import EmailMessage
msg = EmailMessage()
msg.set_content('EMAIL TEST.')
msg['From'] = sender_email
msg['To'] = receiver_email
msg['Cc'] = cc_email
msg['Subject'] = 'PythonAnywhere Test Message'
server = smtplib.SMTP_SSL('smtp.gmail.com', 465)
server.login(sender_email, password)
server.send_message(msg)
server.quit()
I am using an app password I have 2 factor There are no new security events flagged at google it works on my local machine but not on pythonanywhere
What am I doing wrong