BCC in Mail Function
Moderator: General Moderators
-
PastorHank
- Forum Contributor
- Posts: 117
- Joined: Sat Jun 03, 2006 7:58 am
- Location: Texas Hill Country
BCC in Mail Function
Would someone mind telling me how to include a BCC using the Mail() function or point me towards a tutorial for it? I can get the main 'To' working, but can't find anything about copies, I googled it and get pretty much plain vanilla explainations of the function itself.
thank you
thank you
-
PastorHank
- Forum Contributor
- Posts: 117
- Joined: Sat Jun 03, 2006 7:58 am
- Location: Texas Hill Country
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
I'm not sure mail() will handle it correctly though. Bcc is an odd one because it only shows up for the Bcc recipient... even if multiple Bcc addresses are given only the individual recipient address should only be shown in their own email. This means sending the email to each Bcc recipient separately with the additonal headers. Test it first before using it in production and if it doesn't work, either call the mail() function twice or use something that support Bcc correctly.... I'm not even going to say it 
-
PastorHank
- Forum Contributor
- Posts: 117
- Joined: Sat Jun 03, 2006 7:58 am
- Location: Texas Hill Country
-
PastorHank
- Forum Contributor
- Posts: 117
- Joined: Sat Jun 03, 2006 7:58 am
- Location: Texas Hill Country
For windows servers, like Merak, Sambar, hMailServer, Exchange they seem to follow RFC 1327 (Disclose-Recipients), which states that a Bcc To: should follow the RCPT To:, even if the (Disclose-Recipients) is set to true, it should never be placed in the header! So the mail function will not work for those servers, because they look for blind copy to be passed in the set command only. Unix/Linux most MTA(s) look in the header and if a bcc is found only the address to the BCC would get the message, and the BCC would would be removed. But if (Disclose-Recipients) is set to true, then even the BCC would remain. All MTA(s) that know of, also accept the Bcc To: in the set command.
pif
pif
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Swift copies in all Cc and To addresses as envelope recipients sending just one email and then ajusts the headers for each Bcc recipient sending each one in turn. This should work on all MTAs and is the way it's described in RFC 2821.printf wrote:For windows servers, like Merak, Sambar, hMailServer, Exchange they seem to follow RFC 1327 (Disclose-Recipients), which states that a Bcc To: should follow the RCPT To:, even if the (Disclose-Recipients) is set to true, it should never be placed in the header! So the mail function will not work for those servers, because they look for blind copy to be passed in the set command only. Unix/Linux most MTA(s) look in the header and if a bcc is found only the address to the BCC would get the message, and the BCC would would be removed. But if (Disclose-Recipients) is set to true, then even the BCC would remain. All MTA(s) that know of, also accept the Bcc To: in the set command.
pif