Hi,
I like to put a Bcc into a mail function. I haven’t find an example for this yet.
How can I make this work?
Thanks in advance
Ron
How to add Bcc in mail
Re: How to add Bcc in mail
Hi There,
Someone a hint for me?
Someone a hint for me?
Re: How to add Bcc in mail
Hi,
AppGini's sendMail-function in incFunction.php does not support CC or BCC, yet (Ver. 5.75), allthough the PHPMailer class being used, does. I have asked Ahmed to support CC and BCC. I think it's on his roadmap.
In between I have solved it this way:
Best,
Jan
PS: If you need more than one bcc- or cc-recipient, you can for example add a comma-separated list like this...
...and in your sendMailEx-function, split the string using PHP explode-function (https://www.php.net/manual/de/function.explode.php) and add each address using $pm->addCC($item);
AppGini's sendMail-function in incFunction.php does not support CC or BCC, yet (Ver. 5.75), allthough the PHPMailer class being used, does. I have asked Ahmed to support CC and BCC. I think it's on his roadmap.
In between I have solved it this way:
- Copy the sendMail-function from incFunction.php
- Paste it in one of your PHP files and give it a different name (important!), for example sendMailEx
- Check the PHPMailer documentation here:
https://github.com/PHPMailer/PHPMailer - Change the new sendMailEx-function:
below......add something like...Code: Select all
$pm->addAddress($mail['to'], $mail['name']);
Code: Select all
if ($mail['bcc]) $pm->addBCC($mail['bcc']); if ($mail['cc']) $pm->addCC($mail['cc']);
- In your calling function, add the BCC recipient to your $mail-array like this:
Code: Select all
$mail['bcc'] = "[email protected]";
- Now you can call the new sendMailEx-function:
Code: Select all
sendMailEx($mail);
Best,
Jan
PS: If you need more than one bcc- or cc-recipient, you can for example add a comma-separated list like this...
Code: Select all
$mail['bcc'] = "[email protected],[email protected],[email protected]";
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: How to add Bcc in mail
Hi Jan,
Thanks for the answers. As I"m not that familiar with PHP, I"ll give it a try.
I"m off the street now for a while
Ron
Thanks for the answers. As I"m not that familiar with PHP, I"ll give it a try.
I"m off the street now for a while
Ron