... or email service provider in production. コードは django.core.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 additional em ... ail sending functionality is needed, use the EmailMessage or EmailMultiAlternatives class. For example, to send a multipart email t ... ... or email service provider in production. コードは django.core.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 additional em ... ail sending functionality is needed, use the EmailMessage or EmailMultiAlternatives class. For example, to send a multipart email t ... ... 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 th ... at send email should: If using any third-party packages that send email, verify their compatibility with MAILERS before making oth ... USE_SSL , EMAIL_USE_TLS mail.get_connection() and the connection arguments to mail functions The fail_silently argument to send_mail() , send_mass_mail() , mail_admins() , mail_managers() , and EmailMessage.send() The auth_user and auth_password argu ... ... 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 th ... at send email should: If using any third-party packages that send email, verify their compatibility with MAILERS before making oth ... USE_SSL , EMAIL_USE_TLS mail.get_connection() and the connection arguments to mail functions The fail_silently argument to send_mail() , send_mass_mail() , mail_admins() , mail_managers() , and EmailMessage.send() The auth_user and auth_password argu ... ... を受けることができます: from django.apps import AppConfig from django.core.signals import setting_changed def my_receiver ( sender , ** kwargs ): print ( "Setting changed!" ) class MyAppConfig ( AppConfig ): ... def ready ( self ): setting_changed . c ... 関数が呼び出されます。シグナルのすべてのレシーバ関数は、登録された順番に1つずつ呼び出されます。 Signal. connect ( receiver , sender = None , weak = True , dispatch_uid = None ) [ソース] ¶ パラメータ : receiver -- このシグナルに接続されるコールバック関数 ... です。詳しくは レシーバ関数 を参照してください。 sender -- シグナルを受信する送信者を指定します。詳しくは 特定の送信者によって送られたシグナルに接続する を参照してください。 we ... ... を受けることができます: from django.apps import AppConfig from django.core.signals import setting_changed def my_receiver ( sender , ** kwargs ): print ( "Setting changed!" ) class MyAppConfig ( AppConfig ): ... def ready ( self ): setting_changed . c ... 関数が呼び出されます。シグナルのすべてのレシーバ関数は、登録された順番に1つずつ呼び出されます。 Signal. connect ( receiver , sender = None , weak = True , dispatch_uid = None ) [ソース] ¶ パラメータ : receiver -- このシグナルに接続されるコールバック関数 ... です。詳しくは レシーバ関数 を参照してください。 sender -- シグナルを受信する送信者を指定します。詳しくは 特定の送信者によって送られたシグナルに接続する を参照してください。 we ... ... quests 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 does not pr ... 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 ( subject = subj ... ator is a Task instance. Task attributes can be customized via the @task decorator arguments: from django.core.mail import send_mail from django.tasks import task @task ( priority = 2 , queue_name = "emails" ) def email_users ( emails , subject , mes ... ... quests 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 does not pr ... 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 ( subject = subj ... ator is a Task instance. Task attributes can be customized via the @task decorator arguments: from django.core.mail import send_mail from django.tasks import task @task ( priority = 2 , queue_name = "emails" ) def email_users ( emails , subject , mes ... ... y.EmailBackend" , "OPTIONS" : { "region" : "africa-1" }, }, } You can select a mailer with the new using argument to email sending functions, or obtain an email backend instance with mail.mailers[alias] . See メールを送信する for more details. MAILER ... nd names and argument choices. The loaddata command now calls m2m_changed signals with raw=True when loading fixtures. The sendtestemail command now supports a --using option to specify the MAILERS alias. モデル ¶ QuerySet.in_bulk() now supports chai ... Under ASGI, RemoteUserMiddleware no longer prefixes HTTP_ when looking up custom values in request.META . For example, to send -H "AuthUser: ..." , the header attribute should be HTTP_AUTHUSER . This restores the behavior prior to Django 5.2. (The d ... ... y.EmailBackend" , "OPTIONS" : { "region" : "africa-1" }, }, } You can select a mailer with the new using argument to email sending functions, or obtain an email backend instance with mail.mailers[alias] . See メールを送信する for more details. MAILER ... nd names and argument choices. The loaddata command now calls m2m_changed signals with raw=True when loading fixtures. The sendtestemail command now supports a --using option to specify the MAILERS alias. モデル ¶ QuerySet.in_bulk() now supports chai ... Under ASGI, RemoteUserMiddleware no longer prefixes HTTP_ when looking up custom values in request.META . For example, to send -H "AuthUser: ..." , the header attribute should be HTTP_AUTHUSER . This restores the behavior prior to Django 5.2. (The d ... 2026年10月08日