Forums

SMTP & Pythonanywhere

Does pythonanywhere block outgoing connections to SMTP servers? I have tried SMTPS over port 25 and SMTP over port 587 using python & smtplib. The scripts for both versions worked on my laptop but on pythonanywhere I get following error:

An error occurred while sending the email: [Errno 111] Connection refused

I've checked with my mailserver provider all-inkl.com that the IP address from pythonanywhere is not blocked (determined it using the request plugin and a prompt to google.com)

I first though the problem is related to my mailserver provider but now it seems it could also be related to a pythonanywhere setting.

Free PythonAnywhere accounts have restricted Internet access, so you won't be able to connect to external SMTP servers, with the exception of Gmail's. There's more information on this help page.

Paid accounts have unrestricted Internet access, so that doesn't apply to them.