public/wordpress/wp-content/plugins/backupbuddy/destinations/email/init.php
/*	test()
	 *	
	 *	Sends a text email with ImportBuddy.php zipped up and attached to it.
	 *	
	 *	@param		array			$settings	Destination settings.
	 *	@return		bool|string					True on success, string error message on failure.
	 */
test()

Sends a text email with ImportBuddy.php zipped up and attached to it.

@param          array                   $settings       Destination settings.
@return         bool|string                                     True on success, string error message on failure.
test () Sends a text email with ImportBuddy . php zipped up and attached to it . @param array $settings Destination settings . @return bool|string True on success string error message on failure .
public static function test( $settings ) {
		$email = $settings['address'];
		pb_backupbuddy::status( 'details', 'Testing email destination. Sending ImportBuddy.php.' );
		pb_backupbuddy::anti_directory_browsing( backupbuddy_core::getTempDirectory(), $die = false );
		$importbuddy_temp = backupbuddy_core::getTempDirectory() . 'importbuddy_' . pb_backupbuddy::random_string( 10 ) . '.php.tmp'; 
		backupbuddy_core::importbuddy( $importbuddy_temp ); 
		$files = array( $importbuddy_temp );
		if ( pb_backupbuddy::$options['email_return'] != '' ) {
			$email_return = pb_backupbuddy::$options['email_return'];
		} else {
			$email_return = get_option('admin_email');
		}
		$headers = 'From: BackupBuddy <' . $email_return . '>' . "\r\n";
		$wp_mail_result = wp_mail( $email, 'BackupBuddy Test', 'BackupBuddy destination test for ' . site_url(), $headers, $files );
		pb_backupbuddy::status( 'details',  'Sent test email.' );
		@unlink( $importbuddy_temp );
		if ( $wp_mail_result === true ) { 
			return true;
		} else { 
			echo 'WordPress was unable to attempt to send email. Check your WordPress & server settings.';
			return false;
		}
	}
public static function test ( $ settings ) { $ email = $ settings [ 'address' ] ; pb_backupbuddy :: status ( 'details' , 'Testing email destination. Sending ImportBuddy.php.' ) ; pb_backupbuddy :: anti_directory_browsing ( backupbuddy_core :: getTempDirectory ( ) , $ die = false ) ; $ importbuddy_temp = backupbuddy_core :: getTempDirectory ( ) . 'importbuddy_' . pb_backupbuddy :: random_string ( 10 ) . '.php.tmp' ; backupbuddy_core :: importbuddy ( $ importbuddy_temp ) ; $ files = array ( $ importbuddy_temp ) ; if ( pb_backupbuddy :: $ options [ 'email_return' ] != '' ) { $ email_return = pb_backupbuddy :: $ options [ 'email_return' ] ; } else { $ email_return = get_option ( 'admin_email' ) ; } $ headers = 'From: BackupBuddy <' . $ email_return . '>' . " \r \n " ; $ wp_mail_result = wp_mail ( $ email , 'BackupBuddy Test' , 'BackupBuddy destination test for ' . site_url ( ) , $ headers , $ files ) ; pb_backupbuddy :: status ( 'details' , 'Sent test email.' ) ; @ unlink ( $ importbuddy_temp ) ; if ( $ wp_mail_result === true ) { return true ; } else { echo 'WordPress was unable to attempt to send email. Check your WordPress & server settings.' ; return false ; } }
test()
test ()
// Full path & filename to temporary importbuddy // Create temporary importbuddy. // WP sent. Hopefully it makes it! // WP couldn't try to send.