when i execute this code it shows ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
import os
import smtplib
from flask import *
from flask_mail import *
app = Flask(__name__)
mail = Mail(app)
app.config['MAIL_SERVER']='smtp.gmail.com'
app.config['MAIL_PORT']=465
app.config['MAIL_USERNAME'] = os.environ.get('User' )
app.config['MAIL_PASSWORD'] = os.environ.get('Password' )
app.config['MAIL_USE_TLS'] = True
app.config['MAIL_USE_SSL'] = True
@app.route('/')
def index():
msg = Message('HEllo',sender=["joyciimmaculate@gmail.com"], recipients = ["joyciimmaculate@gmail.com"])
msg.body = "hi bulk sms"
msg.html ="<img src="/static/deepa.jpg" style='width:500px;height:228px;'>"
mail.send(msg)
return "mail sent"```