Page 1 of 1

nuSendEmail: CC and BCC removed?

Posted: Tue Oct 22, 2019 5:03 pm
by kev1n
Hi,

While updating a nuBuilder Forte project to the latest version, I noticed that emails do no reach the recipients that are in CC and BCC anyomore. Taking a closer look at the function nuSendEMail(), I noticed that although nuSendEmails takes a CC and BCC parameters, nuEMail() doesn't.
Is there a reason for that? While I'm waiting for an answer, I'll modify the function so that CC and BCC work again.

Code: Select all

function nuSendEmail($to, $from, $fromname, $content, $subject, $filelist, $html = false, $cc = "", $bcc = "", $reply_to_addresses = array()) {
	// nuSendEmail function is being retired and replaced with nuSendEmail
	$to_list	= explode(',',$to);
	return nuEmail($to_list,$from,$fromname,$content,$subject,$filelist,$html,$reply_to_addresses);
}

Re: nuSendEmail: CC and BCC removed?

Posted: Wed Oct 23, 2019 6:23 am
by kev1n
I made the following changes to make CC and BCC work again:

nucommon.php:

Code: Select all

function nuSendEmail($to, $from, $fromname, $content, $subject, $filelist, $html = false, $cc = "", $bcc = "", $reply_to_addresses = array()) {

	// nuSendEmail function is being retired and replaced with nuSendEmail
	$to_list	= explode(',',$to);
	$cc_list	= explode(',',$cc); // added
	$bcc_list	= explode(',',$bcc); // added
	// return nuEmail($to_list,$from,$fromname,$content,$subject,$filelist,$html,$reply_to_addresses); // removed
	return nuEmail($to_list,$from,$fromname,$content,$subject,$filelist,$html,$cc_list, $bcc_list,$reply_to_addresses); // added
}
nuemailer.php

Replace:

Code: Select all

// function nuEmail($to_list=array(),$from_address='',$from_name='',$content='',$subject='',$file_list=array(),$html=false,$reply_to_list=array(),$debug=0,$method='SMTP')  // removed
With

Code: Select all

function nuEmail($to_list=array(),$from_address='',$from_name='',$content='',$subject='',$file_list=array(),$html=false,$cc_list=array(), $bcc_list=array(), $reply_to_list=array(),$debug=0,$method='SMTP')  // changed
and add after: _nuEmailHelperAdd($mail, $nuEmailSettings->reply_to_list, 'AddReplyTo');

Code: Select all

       
_nuEmailHelperAdd($mail, $cc_list,                              'AddCC'); // added
_nuEmailHelperAdd($mail, $bcc_list,                             'AddBCC'); // added

Re: nuSendEmail: CC and BCC removed?

Posted: Sat Nov 09, 2019 11:53 pm
by admin
kevin,

Your changes are in the next release coming soon.

Please test them for me.


Steven

Re: nuSendEmail: CC and BCC removed?

Posted: Sun Nov 10, 2019 7:39 am
by kev1n
Steven, this also needs to be added to _nuEmailHelperAdd() to make it work.
kev1n wrote:
and add after: _nuEmailHelperAdd($mail, $nuEmailSettings->reply_to_list, 'AddReplyTo');

Code: Select all

       
_nuEmailHelperAdd($mail, $cc_list,                              'AddCC'); // added
_nuEmailHelperAdd($mail, $bcc_list,                             'AddBCC'); // added
helper.PNG

Re: nuSendEmail: CC and BCC removed?

Posted: Mon Nov 11, 2019 12:21 am
by admin
kev1n,

Can you attached a working file?


Steven

Re: nuSendEmail: CC and BCC removed?

Posted: Mon Nov 11, 2019 3:12 am
by kev1n
Steven,

Here you go.
nuemailer.zip

Re: nuSendEmail: CC and BCC removed?

Posted: Tue Nov 12, 2019 1:03 am
by admin
kev1n,

It is live now on https://github.com/steven-copley/nubuilder4.

If you can test it and everything is fine, I'll put it on SourceForge.


Thanks, Steven

Re: nuSendEmail: CC and BCC removed?

Posted: Tue Nov 12, 2019 8:57 am
by kev1n
Steven, CC und BCC works fine. I've been using it in production for more than 2 weeks.

I would be glad if you could shed a light on this matter:

nuSendEmail: $from, $fromname ignored?

https://forums.nubuilder.cloud/viewtopic.php?f=19&t=10086