Changeset 39655
- Timestamp:
- 12/30/2016 06:43:07 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/pluggable.php
r39639 r39655 186 186 if ( isset( $atts['to'] ) ) { 187 187 $to = $atts['to']; 188 } 189 190 if ( !is_array( $to ) ) { 191 $to = explode( ',', $to ); 188 192 } 189 193 … … 350 354 $from_name = apply_filters( 'wp_mail_from_name', $from_name ); 351 355 352 $phpmailer->setFrom( $from_email, $from_name, false ); 353 354 // Set destination addresses 355 if ( !is_array( $to ) ) 356 $to = explode( ',', $to ); 356 try { 357 $phpmailer->setFrom( $from_email, $from_name, false ); 358 } catch ( phpmailerException $e ) { 359 $mail_error_data = compact( 'to', 'subject', 'message', 'headers', 'attachments' ); 360 $mail_error_data['phpmailer_exception_code'] = $e->getCode(); 361 362 /** This filter is documented in wp-includes/pluggable.php */ 363 do_action( 'wp_mail_failed', new WP_Error( 'wp_mail_failed', $e->getMessage(), $mail_error_data ) ); 364 365 return false; 366 } 357 367 358 368 // Set mail's subject and body … … 360 370 $phpmailer->Body = $message; 361 371 362 // Use appropriate methods for handling addresses, rather than treating them as generic headers372 // Set destination addresses, using appropriate methods for handling addresses 363 373 $address_headers = compact( 'to', 'cc', 'bcc', 'reply_to' ); 364 374
Note: See TracChangeset
for help on using the changeset viewer.