Created
          July 2, 2021 10:15 
        
      - 
      
- 
        Save seebeen/76b65141b9c4cbe2e834af56e03180c6 to your computer and use it in GitHub Desktop. 
    WordPress PHPMailer SMTP
  
        
  
    
      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 characters
    
  
  
    
  | <?php | |
| namespace Extremis\Core; | |
| use PHPMailer\PHPMailer\PHPMailer; | |
| class SMTP | |
| { | |
| public function __construct() | |
| { | |
| add_action('phpmailer_init', [$this, 'configureSMTP']); | |
| } | |
| public function configureSMTP(PHPMailer $phpmailer) | |
| { | |
| $phpmailer->isSMTP(); | |
| $phpmailer->Host = 'server.hostname.ili.ip'; | |
| $phpmailer->Port = '587'; | |
| $phpmailer->SMTPSecure = true; | |
| $phpmailer->SMTPAuth = true; | |
| $phpmailer->Username = '[email protected]'; | |
| $phpmailer->Password = 'sifra_za_email'; | |
| $phpmailer->From = '[email protected]'; | |
| $phpmailer->FromName = 'Ime sa kog se salje'; | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment