i want to use bcc or cc function in this mail function?

后端 未结 3 634
闹比i
闹比i 2020-12-12 03:18

i want to use bcc or cc function in this mail function?

Here My Mail Function

 

        
3条回答
  •  甜味超标
    2020-12-12 03:39

    It is very simple, just sharing if anyone gets help from here:

    //......
    //...Other setting goes here....
    
    // Always set content-type when sending HTML email
    $headers = "MIME-Version: 1.0" . "\r\n";
    $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
    
    // More headers
    $headers .= 'From: My Name '. "\r\n";
    //Multiple CC can be added, if we need (comma separated);
    $headers .= 'Cc: myboss1@example.com, myboss2@example.com' . "\r\n";
    //Multiple BCC, same as CC above;
    $headers .= 'Bcc: myboss3@example.com, myboss4@example.com' . "\r\n";
    
    mail($to, $subject, $message,  $headers);
    

提交回复
热议问题