Hi,
Is it possible to hardcode the bcc email address somewhere - it has has to be different from the "from" address. In our case the "from" address is accounts@......, which is where we want any replies to go. However, emails to that address go into a support ticket system, which causes a loop if we bcc the same address - the bcc sends it to accounts@........, accounts@.......... generates a ticket and sends a confirmation of that to - you guessed it, accounts@............, which generates a support ticket and sends it to............
So, to cut a long story short, I would like to send a bcc to a different address so that we do have a record of the email going out, say invoicesent@.........
Possible?
Thanks a lot,
Theo
hey theo
edit modules/invoices/email.php
change from
//allow split of email address via , or ;
if (!empty($_POST['email_bcc']))
{
$bcc_addresses = preg_split('/\s*[,;]\s*/', $_POST['email_bcc']);
foreach ($bcc_addresses as $bcc)
{
$mail->AddBCC($bcc);
}
}
to
$mail->AddBCC('[email protected]');
test and let us know how you go
Cheers
Justin
Hi Justin,
Thanks for the reply - no cigar though......... clearly I am doing something wrong but I can't figure out what. This what I have now:
//allow split of email address via , or ;
if (!empty($_POST['email_bcc']))
{
$bcc_addresses = preg_split('/\s*[,;]\s*/', $_POST['email_bcc']);
foreach ($bcc_addresses as $bcc)
{
$mail->AddBCC('[email protected]');
}
}
If that is incorrect, could you nudge me in the right direction?
Thanks a lot
Theo
hey theo
just delete all that if (!empty($_POST['email_bcc'])){ $bc and replace it with the one line - as detaield below
from:
//allow split of email address via , or ;
if (!empty($_POST['email_bcc']))
{
$bcc_addresses = preg_split('/\s*[,;]\s*/', $_POST['email_bcc']);
foreach ($bcc_addresses as $bcc)
{
$mail->AddBCC('[email protected]');
}
}
to:$mail->AddBCC('[email protected]');
test and let us know how you go
cheers
justin
Correction - it DOES work!
Silly me - the Bcc field still shows the same as the FROM field - in our case accounts@mydomain. So I never went any further and actually emailed the invoice. It does actually go to the underlying hardcoded email address though. Found that out by actually emailing it.
So, COOL it works. Is there a way of letting the bcc field reflect the correct email address? Not a big issue but it would be nice.
Thanks again
Theo
Is there a way of letting the bcc field reflect the correct email address?
Hi Justin,
While it works correctly now - the Bcc field still reflects the same as the "From" field - in our case [email protected] Even though it actually goes to [email protected] It's not a big thing at all, but I can see staff being confused when they email an invoice and the Bcc field appears as accounts@, but actually goes to invoicesent@.
Hope that clarifies what I was trying to say?
Cheers,
Theo
It looks like you're new here. If you want to get involved, click one of these buttons!