Django

Code

Ticket #1555: mail_with_port.diff

File mail_with_port.diff, 0.9 kB (added by bde3@cornell.edu, 3 years ago)

patch to allow any SMTP port

  • django/conf/global_settings.py

    old new  
    8686 
    8787# Host for sending e-mail. 
    8888EMAIL_HOST = 'localhost' 
     89# Port for sending e-mail.  Default is standard SMTP port. 
     90EMAIL_PORT = 25 
    8991 
    9092# Optional SMTP authentication information for EMAIL_HOST. 
    9193EMAIL_HOST_USER = '' 
  • django/core/mail.py

    old new  
    3030    If auth_user and auth_password are set, they're used to log in. 
    3131    """ 
    3232    try: 
    33         server = smtplib.SMTP(settings.EMAIL_HOST
     33        server = smtplib.SMTP(settings.EMAIL_HOST, settings.EMAIL_PORT
    3434        if auth_user and auth_password: 
    3535            server.login(auth_user, auth_password) 
    3636    except: