WordPress.org

Make WordPress Core

Ticket #10420: 10420_2.patch

File 10420_2.patch, 483 bytes (added by nacin, 6 years ago)

Allow multiple recipients in wp_mail (array only)

  • pluggable.php

     
    374374        $phpmailer->FromName = apply_filters( 'wp_mail_from_name', $from_name ); 
    375375 
    376376        // Set destination address 
    377         $phpmailer->AddAddress( $to ); 
     377        foreach ( (array) $to as $recipient ) { 
     378                $phpmailer->AddAddress( trim($recipient) ); 
     379        } 
    378380 
    379381        // Set mail's subject and body 
    380382        $phpmailer->Subject = $subject;