Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the bcc information in email header using PHP mailer script

Tags:

php

I am using php mailer script for sending emails in my project. When i send mail with bcc using the below code

$mail->AddBCC([email protected])

The email received by [email protected] user but information content showed in the header of the email received doesn’t show BCC information as below.

Bcc: [email protected] 

How can I achieve it. Thanks in advance.

like image 258
Samsu Avatar asked Nov 23 '12 06:11

Samsu


People also ask

Can you find BCC in email header?

Note that the BCC and To recipients are not specified in the "headers" field.

How do I BCC in PHP?

For example, mail("[email protected], [email protected]", SUBJECT, MESSAGE); To add CC and BCC in PHP mail, we have to manually set the “Cc” and “Bcc” fields in the mail headers. For example, mail(TO, SUBJECT, MESSAGE, "Cc: [email protected]\r\nBcc: [email protected]");

How to send emails with PHP mail() function and PHP Mailer?

To send an email using the PHP mail feature, create a new PHP file in the public_html directory and input the mail() function. Then, execute the script using your web browser.


1 Answers

BCC information is automatically moved from BCC to RCPT field by the SMTP server. You will not see BCC fields in the recipient's mailbox.

You will find a good answer to a similar question here: https://stackoverflow.com/a/2750359/239599

like image 56
naivists Avatar answered Sep 30 '22 07:09

naivists