Changeset 17753
- Timestamp:
- 04/28/2011 06:16:01 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/pluggable.php
r17612 r17753 282 282 require_once ABSPATH . WPINC . '/class-phpmailer.php'; 283 283 require_once ABSPATH . WPINC . '/class-smtp.php'; 284 $phpmailer = new PHPMailer( );284 $phpmailer = new PHPMailer( true ); 285 285 } 286 286 … … 401 401 402 402 foreach ( (array) $to as $recipient ) { 403 $phpmailer->AddAddress( trim( $recipient ) ); 403 try { 404 $phpmailer->AddAddress( trim( $recipient ) ); 405 } catch ( phpmailerException $e ) { 406 continue; 407 } 404 408 } 405 409 … … 411 415 if ( !empty( $cc ) ) { 412 416 foreach ( (array) $cc as $recipient ) { 413 $phpmailer->AddCc( trim($recipient) ); 417 try { 418 $phpmailer->AddCc( trim($recipient) ); 419 } catch ( phpmailerException $e ) { 420 continue; 421 } 414 422 } 415 423 } … … 417 425 if ( !empty( $bcc ) ) { 418 426 foreach ( (array) $bcc as $recipient) { 419 $phpmailer->AddBcc( trim($recipient) ); 427 try { 428 $phpmailer->AddBcc( trim($recipient) ); 429 } catch ( phpmailerException $e ) { 430 continue; 431 } 420 432 } 421 433 } … … 456 468 if ( !empty( $attachments ) ) { 457 469 foreach ( $attachments as $attachment ) { 458 $phpmailer->AddAttachment($attachment); 470 try { 471 $phpmailer->AddAttachment($attachment); 472 } catch ( phpmailerException $e ) { 473 continue; 474 } 459 475 } 460 476 } … … 463 479 464 480 // Send! 465 $result = @$phpmailer->Send(); 466 467 return $result; 481 try { 482 $phpmailer->Send(); 483 } catch ( phpmailerException $e ) { 484 return false; 485 } 486 487 return true; 468 488 } 469 489 endif;
Note: See TracChangeset
for help on using the changeset viewer.