Page 1 of 1
BCC in Mail Function
Posted: Mon Jun 26, 2006 4:23 pm
by PastorHank
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
Posted: Mon Jun 26, 2006 4:30 pm
by feyd
BCC is apart of extended header information. It gets passed to the headers argument.
Posted: Mon Jun 26, 2006 4:33 pm
by PastorHank
thank you
Posted: Mon Jun 26, 2006 5:02 pm
by Chris Corbyn
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

Posted: Mon Jun 26, 2006 5:10 pm
by PastorHank
I've been trying it using the extended headers and it doesn't seem to be working, I'm new to php so if there's something out there that I can use in place of the mail() function, I'd appreciate hearing about it.
Posted: Mon Jun 26, 2006 5:11 pm
by feyd
hint: read his signature.
Posted: Mon Jun 26, 2006 5:12 pm
by PastorHank
Ah, I see said the blind man...
Posted: Mon Jun 26, 2006 5:18 pm
by printf
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
Posted: Mon Jun 26, 2006 6:19 pm
by Chris Corbyn
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
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.