Ticket #5248: mail_options.diff
File mail_options.diff, 2.6 KB (added by , 17 years ago) |
---|
-
django/conf/global_settings.py
127 127 EMAIL_HOST_PASSWORD = '' 128 128 EMAIL_USE_TLS = False 129 129 130 # Optional SMTP mail_options 131 EMAIL_MAIL_OPTIONS = [] 132 130 133 # List of strings representing installed apps. 131 134 INSTALLED_APPS = () 132 135 -
django/core/mail.py
107 107 """ 108 108 109 109 def __init__(self, host=None, port=None, username=None, password=None, 110 use_tls=None, fail_silently=False ):110 use_tls=None, fail_silently=False, mail_options=[]): 111 111 self.host = host or settings.EMAIL_HOST 112 112 self.port = port or settings.EMAIL_PORT 113 113 self.username = username or settings.EMAIL_HOST_USER 114 114 self.password = password or settings.EMAIL_HOST_PASSWORD 115 115 self.use_tls = (use_tls is not None) and use_tls or settings.EMAIL_USE_TLS 116 116 self.fail_silently = fail_silently 117 self.mail_options = mail_options or settings.EMAIL_MAIL_OPTIONS 117 118 self.connection = None 118 119 119 120 def open(self): … … 180 181 try: 181 182 self.connection.sendmail(email_message.from_email, 182 183 email_message.recipients(), 183 email_message.message().as_string()) 184 email_message.message().as_string(), 185 self.mail_options) 184 186 except: 185 187 if not self.fail_silently: 186 188 raise -
docs/email.txt
36 36 .. _EMAIL_HOST_USER: ../settings/#email-host-user 37 37 .. _EMAIL_HOST_PASSWORD: ../settings/#email-host-password 38 38 .. _EMAIL_USE_TLS: ../settings/#email-use-tls 39 .. _EMAIL_MAIL_OPTIONS: ../settings/#email-mail-options 39 40 40 41 send_mail() 41 42 =========== -
docs/settings.txt
426 426 427 427 See also ``EMAIL_HOST_PASSWORD``. 428 428 429 EMAIL_MAIL_OPTIONS 430 ------------------ 431 432 Default: ``[]`` 433 434 The ESMTP options to use when sending mail to the SMTP server defined in 435 ``EMAIL_HOST``. The ESMTP options vary by MTA. Example: Passing ['XVERP'] to 436 Postfix, will enable varible envelope return path (VERP) delivery of messages. 437 429 438 EMAIL_PORT 430 439 ---------- 431 440