【问题标题】:PHP Form - bcc mail not sent from email formPHP 表单 - 密件抄送邮件未从电子邮件表单发送
【发布时间】:2016-01-12 11:45:03
【问题描述】:

你好,这是我发送电子邮件的 php 代码,当发送邮件时,密件抄送部分中的地址不会收到电子邮件:

<?php
$to = "abc@abc.com";
    $subject  = 'Form Submited To ABC Website';
    $headers = "From: online@abc.com \r\n";
    $headers .= "Bcc: info@abc.com \r\n";
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=utf-8\r\n";
?>

出于保密原因,这些邮件不是 rals 的

【问题讨论】:

    标签: php email bcc


    【解决方案1】:

    PHP mail() 语法是:

    bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )
    

    找到下面的代码以获得更多理解。

    <?php
    // multiple recipients
    $to  = 'aidan@example.com' . ', '; // note the comma, if you have multiple or else no comma.
    $to .= 'wez@example.com';
    
    // subject
    $subject = 'Hello';
    
    // message
    $message = '<html><body><h2>Testing MSG</h2></body>';
    
    // To send HTML mail, the Content-type header must be set
    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    
    // Additional headers
    $headers .= 'To: Jiten <Jiten@example.com>, Kelly <hi@example.com>' . "\r\n";
    $headers .= 'From: from_name <from_name@example.com>' . "\r\n";
    $headers .= 'Cc: cc_email@example.com' . "\r\n";
    $headers .= 'Bcc: bcc@example.com' . "\r\n";
    
    // Mail it
    mail($to, $subject, $message, $headers);
    

    【讨论】:

      猜你喜欢
      • 2012-03-20
      • 2015-04-03
      • 2020-10-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-22
      • 1970-01-01
      相关资源
      最近更新 更多