1

Here is

smtp = smtplib.SMTP(server)

I want to make it more customizable with additional parameter of timeout and port.

I want to send email using SMTP python with the port that runs on any host (but don't want to use port 25 ) and I'm unable to set out timeout on it.

arulmr
  • 7,806
  • 8
  • 48
  • 67
  • 1
    may be this link help. http://stackoverflow.com/questions/64505/sending-mail-from-python-using-smtp – Pratibha Feb 01 '13 at 08:07

1 Answers1

1

Have you tried setting port and timeout ?

 smtplib.SMTP(server, port=1234, local_hostname='your_local_host', timeout=10)

Or tried reading the documentation?

danodonovan
  • 17,150
  • 6
  • 64
  • 73