... t. Instead, email is printed to the console as a development aid (for projects created with startproject ) or results in a MailerDoesNotExist error (when the MAILERS setting isn't defined). Use the MAILERS setting to tell Django how to send email. For ... example, to send through an SMTP server running on the local machine: MAILERS = { "default" : { "BACKEND" : "django.core.mail.backends.smtp.EmailBackend" , "OPTIONS" : { "host" : "localhost" , }, }, ... During development or testing you often don't want to send email at all. Django's test runner automatically overrides the MAILERS configuration to substitute Django's memory email backend . This prevents test cases from sending real email and gives th ... ... }, } AdminEmailHandler を使用する際は、 ログのセキュリティ上の注意点 に注意してください。 Email is sent using the default mailer . This can be overridden by setting the using argument of AdminEmailHandler , like this: "handlers" : { "mail_admins" : { ... "level" : "ERROR" , "class" : "django.utils.log.AdminEmailHandler" , "using" : "internal" , }, } If the specified mailer is not configured in the MAILERS setting, no email will be sent and no additional error will be raised. By setting the dep ... nEmailHandler , the email backend that is being used by the handler can be overridden. email_backend is not supported when MAILERS is defined or when the using argument is provided. AdminEmailHandler の reporter_class 引数では、メール本文で送信されるト ... ... 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 mechanis ... ms for CACHES , DATABASES , STORAGES , and TASKS : MAILERS = { "default" : { "BACKEND" : "django.core.mail.backends.smtp.EmailBackend" , "OPTIONS" : { "host" : "smtp.example.com" , ... rketing" : { "BACKEND" : "example.third.party.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 ... ... lier connection in Django functions that send email. This guide provides details on migrating existing projects to the new mailers functionality. All Django projects that send email should: If using any third-party packages that send email, verify thei ... r compatibility with MAILERS before making other changes. Update email-related settings . Run with deprecation warnings enabled (see 廃止予定警告を解決 ... mass_mail() The email_backend argument to AdminEmailHandler Migrating settings Often, the only change needed to migrate to mailers is updating email-related settings. In your project's settings, define a MAILERS dict with a "default" entry matching the ... ... バージョン 6.1 で非推奨: This setting is deprecated and will be removed in Django 2028. Its replacement is BACKEND in the MAILERS "default" configuration. See Migrating email to mailers . EMAIL_FILE_PATH デフォルト値: 定義されていません ファイルメール ... で非推奨: This setting is deprecated and will be removed in Django 2028. Its replacement is "file_path" under OPTIONS in a MAILERS definition that uses the file email backend. See Migrating email to mailers . EMAIL_HOST デフォルト値: 'localhost' E メー ... 6.1 で非推奨: This setting is deprecated and will be removed in Django 2028. Its replacement is "host" under OPTIONS in a MAILERS definition that uses the SMTP email backend. See Migrating email to mailers . EMAIL_HOST_PASSWORD デフォルト値: '' (空文字 ... ... 意な CharField の max_length が255を超えることが許可されていない場合があります。 Mail The following checks verify that your MAILERS setting is correctly configured: mail.E001 : Your MAILERS setting uses a development-only email backend in the 'default' ... entry ( <backend> ). (Only checked when the check --deploy option is used.) mail.W001 : Your MAILERS setting has no 'default' entry. Sending email without a valid mailer will fail. ファイルの管理 次のチェックは、 ファイルの ... ... used in any combination with each other and with recipient email arguments. --using ALIAS New in Django 6.1. Specifies the MAILERS alias to use for sending the test email to the recipients given as arguments. Defaults to the "default" mailer. --manager ... ... ールアドレスの列挙タイミング攻撃に対して脆弱になる可能性があることに注意してください。オーバーヘッドを減らすために、 django-mailer などの、非同期でメールを送信できるサードパーティのパッケージを使うことができます。 属性: template_name パスワードリセットフ ... ... ctually sending the messages. The test runner accomplishes this by transparently replacing the BACKEND for each configured MAILERS alias with the 'locmem' memory email backend . (Don't worry -- this has no effect on any other email senders outside of D ... ct. self . assertEqual ( mail . outbox [ 0 ] . subject , "Subject here" ) # Verify the message was sent with the "default" mailer. self . assertEqual ( mail . outbox [ 0 ] . sent_using , "default" ) Changed in Django 6.1: The sent_using attribute was a ... 2026年10月08日