zoukankan      html  css  js  c++  java
  • [Wordpress]Wordpress使用SMTP发送电邮

    参考:phpmailer_init中的代码,可以配置使用SMTP发送电邮
    官方的案例代码是:

    add_action( 'phpmailer_init', 'my_phpmailer_example' );
    function my_phpmailer_example( $phpmailer ) {
        $phpmailer->isSMTP();     
        $phpmailer->Host = 'smtp.example.com';
        $phpmailer->SMTPAuth = true; // Force it to use Username and Password to authenticate
        $phpmailer->Port = 25;
        $phpmailer->Username = 'yourusername';
        $phpmailer->Password = 'yourpassword';
    
        // Additional settings…
        //$phpmailer->SMTPSecure = "tls"; // Choose SSL or TLS, if necessary for your server
        //$phpmailer->From = "you@yourdomail.com";
        //$phpmailer->FromName = "Your Name";
    }
    
  • 相关阅读:
    20210312
    20210311
    20210310
    例5-1
    例5-2
    例4-12-2
    例4-12
    例4-11
    例4-10
    例4-9
  • 原文地址:https://www.cnblogs.com/fsong/p/5854073.html
Copyright © 2011-2022 走看看