Created
March 11, 2022 16:03
-
-
Save Log1x/2b53a11602711d8161b2edf0f5efd880 to your computer and use it in GitHub Desktop.
Revisions
-
Log1x created this gist
Mar 11, 2022 .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,29 @@ <?php use function Env\env; /** * Plugin Name: PHPMailer SMTP * Plugin URI: https://roots.io/bedrock/ * Description: Simple PHPMailer SMTP configuration for Bedrock. * Version: 1.0.0 * Author: Roots * Author URI: https://roots.io/ * License: MIT License */ add_filter('phpmailer_init', function ($mail) { $mail->isSMTP(); $mail->SMTPAuth = true; $mail->Host = env('WP_ENV') === 'development' ? 'localhost' : env('WP_SMTP_HOST'); $mail->Port = env('WP_ENV') === 'development' ? 1025 : 587; $mail->Username = env('WP_SMTP_USERNAME'); $mail->Password = env('WP_SMTP_PASSWORD'); $mail->Timeout = 10; $mail->setFrom( env('WP_SMTP_FORCEFROM'), env('WP_SMTP_FORCEFROMNAME') ); });