Changeset 61010
- Timestamp:
- 10/21/2025 08:04:22 AM (3 weeks ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
src/wp-includes/pluggable.php (modified) (1 diff)
-
tests/phpunit/tests/pluggable/wpMail.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/pluggable.php
r60989 r61010 433 433 434 434 try { 435 $phpmailer->setFrom( $from_email, $from_name , false);435 $phpmailer->setFrom( $from_email, $from_name ); 436 436 } catch ( PHPMailer\PHPMailer\Exception $e ) { 437 437 $mail_error_data = compact( 'to', 'subject', 'message', 'headers', 'attachments' ); -
trunk/tests/phpunit/tests/pluggable/wpMail.php
r60699 r61010 409 409 410 410 /** 411 * Test that the Sender field in the SMTP envelope is not set by Core. 412 * 413 * Correctly setting the Sender requires knowledge that is not available 414 * to Core. An incorrect value will often lead to messages being rejected 415 * by the receiving MTA, so it's the admin's responsibility to 416 * set it correctly. 417 * 418 * @ticket 37736 419 */ 420 public function test_wp_mail_sender_not_set() { 421 wp_mail( 'user@example.org', 'Testing the Sender field', 'The Sender field should not have been set.' ); 422 423 $mailer = tests_retrieve_phpmailer_instance(); 424 425 $this->assertSame( '', $mailer->Sender ); 411 * Test that the Sender field in the SMTP envelope is set by Core. 412 * 413 * A missing Sender field can lead to messages failing DMARC SPF checks. 414 * 415 * @ticket 49687 416 */ 417 public function test_wp_mail_sender_set() { 418 wp_mail( 'user@example.org', 'Testing the Sender field', 'The Sender field should have been set.' ); 419 420 $mailer = tests_retrieve_phpmailer_instance(); 421 422 $this->assertSame( 'wordpress@example.org', $mailer->Sender ); 426 423 } 427 424
Note: See TracChangeset
for help on using the changeset viewer.