📜  wordpress PHPMailer 配置 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:36.078000             🧑  作者: Mango

代码示例1
add_action( 'phpmailer_init', 'setup_phpmailer_init' );
function setup_phpmailer_init( $phpmailer ) {
    $phpmailer->Host = 'HOSTNAME'; // for example, smtp.mailtrap.io
    $phpmailer->Port = 587; // set the appropriate port: 465, 2525, etc.
    $phpmailer->Username = 'YOURUSERNAME'; // your SMTP username
    $phpmailer->Password = 'YOURPASSWORD'; // your SMTP password
    $phpmailer->SMTPAuth = true;
    $phpmailer->SMTPSecure = 'tls'; // preferable but optional
    $phpmailer->IsSMTP();