Forums

Send email with outlook

When I try to send an email with my deployed application in pythonaywhere I get:

[Errno 111] Connection refused

My configuration server = 'smtp.live.com:25' or 'smtp.live.com:587' sender= <outlook account> tls= true

When I do the same with my local application everythings works ok.

Hello: I think the problem is that you have a free account, which only allows internet access to a whitelist of sites, and only using ports 88/443. You will either need to pay to upgrade, or find an email server that accepts connections on port 80/443.

(Alternatively, you will need to go the slightly convoluted route of crafting a web request that matches the way an email is sent through the live.com webmail system. This is, I'm sure, possible. But I suspect it would be (a) very time consuming to implement, and (b) break whenever Microsoft changes anything)

@grantorneo -- rcs1000 is right, it's because PythonAnywhere only lets free accounts make HTTP and HTTPS requests to specific whitelisted sites. There is one exception, though -- we do support access to smtp.gmail.com. Perhaps you can use their server?

Alternatively, you could sign up for a paid account :-)