Last active
May 28, 2024 07:30
Revisions
-
franz-josef-kaiser revised this gist
Apr 22, 2020 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,6 @@ function phpmailerSMTP( $phpmailer ) { # $phpmailer->IsSMTP(); # $phpmailer->SMTPAuth = true; // Authentication # $phpmailer->Username = ''; # $phpmailer->Password = ''; # $phpmailer->SMTPSecure ='ssl'; // enable if required, 'tls' is another possible value -
franz-josef-kaiser revised this gist
Sep 11, 2015 . 2 changed files with 14 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,12 +8,13 @@ add_action( 'phpmailer_init', 'WCMphpmailerException' ); function WCMphpmailerException( $phpmailer ) { if ( ! defined( 'WP_DEBUG' ) OR ! WP_DEBUG ) { $phpmailer->SMTPDebug = 0; $phpmailer->debug = 0; return; } if ( ! current_user_can( 'manage_options' ) ) return; @@ -27,22 +28,23 @@ function WCMphpmailerException( $phpmailer ) compact( 'to', 'subject', 'message', 'headers', 'attachments' ) ); // Show what we got current_user_can( 'manage_options' ) AND print htmlspecialchars( var_export( $phpmailer, true ) ); $error = null; try { $sent = $phpmailer->Send(); ! $sent AND $error = new WP_Error( 'phpmailer-error', $sent->ErrorInfo ); } catch ( phpmailerException $e ) { $error = new WP_Error( 'phpmailer-exception', $e->errorMessage() ); } catch ( Exception $e ) { $error = new WP_Error( 'phpmailer-exception-unknown', $e->getMessage() ); } if ( is_wp_error( $error ) ) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,12 +8,12 @@ add_action( 'phpmailer_init', 'phpmailerSMTP' ); function phpmailerSMTP( $phpmailer ) { # $phpmailer->IsSMTP(); # $phpmailer->SMTPAuth = true; // Authentication # $phpmailer->Host = ''; # $phpmailer->Username = ''; # $phpmailer->Password = ''; # $phpmailer->SMTPSecure ='ssl'; // enable if required, 'tls' is another possible value # $phpmailer->Host = ''; // SMTP Host # $phpmailer->Port = 26; // SMTP Port } -
franz-josef-kaiser revised this gist
Jun 22, 2013 . 2 changed files with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ */ add_action( 'phpmailer_init', 'WCMphpmailerException' ); function WCMphpmailerException( $phpmailer ) { if ( ! defined( 'WP_DEBUG' ) OR ! WP_DEBUG ) { This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ */ add_action( 'phpmailer_init', 'phpmailerSMTP' ); function phpmailerSMTP( $phpmailer ) { # $phpmailer->IsSMTP(); # $phpmailer->SMTPAuth = true; // Authentication -
franz-josef-kaiser revised this gist
Jun 22, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,11 +9,11 @@ function phpmailerSMTP( &$phpmailer ) { # $phpmailer->IsSMTP(); # $phpmailer->SMTPAuth = true; // Authentication # $phpmailer->Host = ''; # $phpmailer->Username = ''; # $phpmailer->Password = ''; # $phpmailer->SMTPSecure = 'ssl'; // enable if required, 'tls' is another possible value # $phpmailer->Host = ''; // SMTP Host # $phpmailer->Port = 26; // SMTP Port } -
franz-josef-kaiser created this gist
Jun 22, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,54 @@ <?php defined( 'ABSPATH' ) OR exit; /** * Plugin Name: (WCM) PHPMailer Exceptions & SMTP * Description: WordPress by default returns <code>FALSE</code> instead of an <code>Exception</code>. This plugin fixes that. */ add_action( 'phpmailer_init', 'WCMphpmailerException' ); function WCMphpmailerException( &$phpmailer ) { if ( ! defined( 'WP_DEBUG' ) OR ! WP_DEBUG ) { $phpmailer->SMTPDebug = 0; $phpmailer->debug = 0; return; } if ( ! current_user_can( 'manage_options' ) ) return; // Enable SMTP # $phpmailer->IsSMTP(); $phpmailer->SMTPDebug = 2; $phpmailer->debug = 1; $data = apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments' ) ); current_user_can( 'manage_options' ) AND print htmlspecialchars( var_export( $phpmailer, true ) ); $error = null; try { $sent = $phpmailer->Send(); ! $sent AND $error = new WP_Error( 'phpmailerError', $sent->ErrorInfo ); } catch ( phpmailerException $e ) { $error = new WP_Error( 'phpmailerException', $e->errorMessage() ); } catch ( Exception $e ) { $error = new WP_Error( 'defaultException', $e->getMessage() ); } if ( is_wp_error( $error ) ) return printf( "%s: %s", $error->get_error_code(), $error->get_error_message() ); } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ <?php defined( 'ABSPATH' ) OR exit; /** * Plugin Name: (WCM) PHPMailer SMTP Settings * Description: Enables SMTP servers, SSL/TSL authentication and SMTP settings. */ add_action( 'phpmailer_init', 'phpmailerSMTP' ); function phpmailerSMTP( &$phpmailer ) { # $phpmailer->IsSMTP(); # $phpmailer->SMTPAuth = true; // Authentication # $phpmailer->Host = ''; # $phpmailer->Username = ''; # $phpmailer->Password = ''; # $phpmailer->SMTPSecure = 'ssl'; // enable if required, 'tls' is another possible value # $phpmailer->Host = ''; // SMTP Host # $phpmailer->port = 26; // SMTP Port }