... also supports swapping in different delivery mechanisms: you can direct email to the console or a file during development and an SMTP server or email service provider in production. コードは django.co ... re.mail モジュールにあります。 簡単な例 ¶ 簡単なメール送信には send_mail() を使用します。たとえば、プレーンテキストのメッセージを送 ... 信するには、次のようにします。 from django.core.mail import send_mail send_mail ( "Subject here" , "Here is the message." , "from@example.com" , [ "to@example.com" ], ) When a ... ... also supports swapping in different delivery mechanisms: you can direct email to the console or a file during development and an SMTP server or email service provider in production. コードは django.co ... re.mail モジュールにあります。 簡単な例 ¶ 簡単なメール送信には send_mail() を使用します。たとえば、プレーンテキストのメッセージを送 ... 信するには、次のようにします。 from django.core.mail import send_mail send_mail ( "Subject here" , "Here is the message." , "from@example.com" , [ "to@example.com" ], ) When a ... ... ed mail.mailers for obtaining configured email backend instances, replacing mail.get_connection() . A new using argument replaces ... the earlier connection in Django functions that send email. This guide provides details on migrating existing projects to the new mailers functionality. All Django projects that sen ... d email should: If using any third-party packages that send email, verify their compatibility with MAILERS before making other cha ... ... ed mail.mailers for obtaining configured email backend instances, replacing mail.get_connection() . A new using argument replaces ... the earlier connection in Django functions that send email. This guide provides details on migrating existing projects to the new mailers functionality. All Django projects that sen ... d email should: If using any third-party packages that send email, verify their compatibility with MAILERS before making other cha ... ... ects before deleting them. As a consequence, the DB_CASCADE option does not trigger the pre_delete or post_delete signals. Mailers ¶ The new MAILERS setting supports configuring multiple email backends with different options, similar to existing mech ... anisms for CACHES , DATABASES , STORAGES , and TASKS : MAILERS = { "default" : { "BACKEND" : "django.core.mail.backends.smtp.EmailBackend" , "OPTIONS" : { "host" : "smtp.example.com" ... , "use_tls" : True }, }, "marketing" : { "BACKEND" : "example.third.party.EmailBackend" , "OPTIONS" : { "region" : "africa-1" }, }, } You can select a mailer with the new using argument to email sending ... ... ects before deleting them. As a consequence, the DB_CASCADE option does not trigger the pre_delete or post_delete signals. Mailers ¶ The new MAILERS setting supports configuring multiple email backends with different options, similar to existing mech ... anisms for CACHES , DATABASES , STORAGES , and TASKS : MAILERS = { "default" : { "BACKEND" : "django.core.mail.backends.smtp.EmailBackend" , "OPTIONS" : { "host" : "smtp.example.com" ... , "use_tls" : True }, }, "marketing" : { "BACKEND" : "example.third.party.EmailBackend" , "OPTIONS" : { "region" : "africa-1" }, }, } You can select a mailer with the new using argument to email sending ... ... n Tasks framework for running code outside the HTTP request–response cycle. This enables offloading work, such as sending emails or processing data, to background workers. The framework provides task definition, validation, queuing, and result handli ... ning them continues to belong to external worker processes. Tasks are defined using the task() decorator: from django.core.mail import send_mail from django.tasks import task @task def email_users ( emails , subject , message ): return send_mail ( su ... bject , message , None , emails ) Once defined, tasks can be enqueued through a configured backend: email_users . enqueue ( emails = [ "user@example.com" ... ... n Tasks framework for running code outside the HTTP request–response cycle. This enables offloading work, such as sending emails or processing data, to background workers. The framework provides task definition, validation, queuing, and result handli ... ning them continues to belong to external worker processes. Tasks are defined using the task() decorator: from django.core.mail import send_mail from django.tasks import task @task def email_users ( emails , subject , message ): return send_mail ( su ... bject , message , None , emails ) Once defined, tasks can be enqueued through a configured backend: email_users . enqueue ( emails = [ "user@example.com" ... ... keeps requests fast, reduces latency, and improves the user experience. For example, a user shouldn't have to wait for an email to send before their page finishes loading. Django's Tasks framework makes it easy to define and enqueue such work. It doe ... nd Defining Tasks ¶ Tasks are defined using the django.tasks.task() decorator on a module-level function: from django.core.mail import send_mail from django.tasks import task @task def email_users ( emails , subject , message ): return send_mail ( su ... bject = subject , message = message , from_email = None , recipient_list = emails ) The return value of the decorator is a Task instance. Task attributes can be customized ... ... keeps requests fast, reduces latency, and improves the user experience. For example, a user shouldn't have to wait for an email to send before their page finishes loading. Django's Tasks framework makes it easy to define and enqueue such work. It doe ... nd Defining Tasks ¶ Tasks are defined using the django.tasks.task() decorator on a module-level function: from django.core.mail import send_mail from django.tasks import task @task def email_users ( emails , subject , message ): return send_mail ( su ... bject = subject , message = message , from_email = None , recipient_list = emails ) The return value of the decorator is a Task instance. Task attributes can be customized ... 2026年10月08日