So, I wrote a SMTPLIB-based program on Python, everything was okay, but when I launched it, at the moment when I connect to an SMTP server, it gives me this:
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine is actively refusing it.
What should I do? BTW, here's the function that gives me this error:
def send_mail(email, password, FROM, TO, msg):
server = smtplib.SMTP("smtp.mail.ru", 587)
server.connect()
server.starttls()
server.login(email, password)
server.sendmail(FROM, TO, msg.as_string())
server.quit()