Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#1555 closed defect (fixed)

[patch][magic-removal] Fix to allow for sending email on non-standard SMTP ports.

Reported by: bde3@… Owned by: Adrian Holovaty
Component: Core (Other) Version: magic-removal
Severity: normal Keywords: mail smtp port
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Fix to allow django.core.mail.send_mail() to work with a non-standard SMTP port. (i.e. not 25)

Attachments (1)

mail_with_port.diff (953 bytes ) - added by bde3@… 18 years ago.
patch to allow any SMTP port

Download all attachments as: .zip

Change History (4)

by bde3@…, 18 years ago

Attachment: mail_with_port.diff added

patch to allow any SMTP port

comment:1 by Chris Beaven, 18 years ago

milestone: Version 0.92

Good, purposeful and easily implemented patch, bde@.

Alternatively, if we didn't want to add another setting, then perhaps EMAIL_HOST could be made to check for a :port. In django/core/mail.py:

port = 25
host = settings.EMAIL_HOST
if ':' in host:
    host, port = host.split(':', 1)
    port = int(port)
server = smtplib.SMTP(host, port) 

You'd also want to change the comment for EMAIL_HOST in django/conf/global_settings.py to reflect this new functionality.

comment:2 by Adrian Holovaty, 18 years ago

Resolution: fixed
Status: newclosed

(In [2665]) Fixed #1555 -- Added EMAIL_PORT setting. Thanks, bde3

comment:3 by Adrian Holovaty, 18 years ago

milestone: Version 0.92

Milestone Version 0.92 deleted

Note: See TracTickets for help on using tickets.
Back to Top