我有一个项目,我正在工作,我正在使用Pear的邮件.我需要使用smtp,因为我们需要能够从邮件服务器跟踪所有内容.用户需要能够在发送基于公司的电子邮件之前登录.我们不能使用php的邮件功能.
我的问题是我无法在网上找到任何有关发送CC和Bcc以及发送多个BCC的文档.使用php'邮件功能很容易.你所要做的就是将它添加到$ header变量中
$headers .= 'Cc: birthdayarchive@example.com' . "\r\n";
$headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";
Run Code Online (Sandbox Code Playgroud)
这是我使用PEAR的php函数的代码
function sender_mail($email,$subject,$mailmsg, $cc, $bcc){
include("Mail.php");
/* mail setup recipients, subject etc */
//DEFAULT VALUE OF FROM
$from = "noreply@addata.net";
//GET EMAIL OF USER
$result = mysql_query("SELECT email, email_pass FROM u_perinfo WHERE user_id = '$_SESSION[uid]'")
or die("There was an error when grabbing your email information");
if(mysql_num_rows($result) > 0){
$row = mysql_fetch_array($result);
if($row[0] != ''){
$from = $row[0];
}
$email_pass = $row[1];
}
$recipients = "$email"; …Run Code Online (Sandbox Code Playgroud)