Question

I'm using PHPMailer to send mails to a clients database when certain events triggers. Obviously I don't want everyone to get the full list of client's emails, so i'm sending those in BCC using PHPMailer. It's working fine, but there is one problem.

The customer that receive the email got nothing in the field of the targeted email. Just blank. Shouldn't he be able to see his own address and own name I'm sending ? It's helpfull for people who are redirecting emails to know which was targeted.

Same goes with PHP native mail() function.

Is there a way to handle this ?

Thanks ahead !

Was it helpful?

Solution 2

That's the nature of email. When a person is BCC'd, they will only see the To:, From: and CC: fields. The BCC field will hide every single email address, even the recipient's.

From wiki:

There are three ways in which the "BCC:" field is used.

In the first case, when a message containing a "BCC:" field is prepared to be sent, the "BCC:" line is removed even though all of the recipients (including those specified in the "BCC:" field) are sent a copy of the message.

In the second case, recipients specified in the "To:" and "CC:" lines each are sent a copy of the message with the "BCC:" line removed as above, but the recipients on the "BCC:" line get a separate copy of the message containing a "BCC:" line. (When there are multiple recipient addresses in the "BCC:" field, some implementations actually send a separate copy of the message to each recipient with a "BCC:" containing only the address of that particular recipient.)

Finally, since a "BCC:" field may contain no addresses, a "BCC:" field can be sent without any addresses indicating to the recipients that blind copies were sent to someone.

OTHER TIPS

No, that's not how BCC works.

If you receive an email via BCC, your mail client will show you the original recipient's address in the 'to' field, not yours.

This applies to all BCC mails; it has nothing to do with phpMailer.

If you want the recipients to see something in the 'to' field, you need to populate it with a dummy value -- for example, 'donotreply@yourdomain.com'.

It is good to send messages like this via BCC, so you're doing the right thing. But if you really want the end user to see his own email address in the 'to' field, then the only way to do it is to send the message to each user as a separate email, so you use the 'to' field and not 'bcc'. However, this will dramatically increase the load on your mail systems, so it's probably not the answer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top