wpcf7_phpmailer_init

The Contact Form 7 wpcf7 phpmailer init function.

Description

wpcf7_phpmailer_init( $phpmailer ); 

Parameters (1)

0. $phpmailer
The phpmailer.

Usage

  1. if ( !function_exists( 'wpcf7_phpmailer_init' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'contact-form-7/includes/mail.php'; 
  3.  
  4. // The phpmailer. 
  5. $phpmailer = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wpcf7_phpmailer_init($phpmailer); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/mail.php  
  1. function wpcf7_phpmailer_init( $phpmailer ) { 
  2. $wpcf7_content_type = false; 
  3.  
  4. foreach ( (array) $phpmailer->getCustomHeaders() as $custom_header ) { 
  5. if ( 'X-WPCF7-Content-Type' == $custom_header[0] ) { 
  6. $wpcf7_content_type = trim( $custom_header[1] ); 
  7. break; 
  8.  
  9. if ( 'text/html' == $wpcf7_content_type ) { 
  10. $phpmailer->msgHTML( $phpmailer->Body );