Array ( [recipients] => Array ( [0] => p@gmail.com ) [subject] => GVP Corrections Entry [body] => GVP Editorial Revision Tracking* Submission completed *Thanks for your input!Name:Joe TestEmail:p@gmail.comVerify Email:p@gmail.comPublication Title:Butter ThiefPublication Version:ver 1Issue Title:Just a testIssue DescriptionEdition: ver 1.just a test, please ignore [from_name] => GVP Corrections Entry [from_email] => webservants@XXX.com [reply_name] => GVP Site Admin [reply_email] => webservants@XXX.com [cc] => Array ( [0] => p@gmail.com ) [result] => the Mail could not be sent. [var] => )"> When CC or BCC has address that is in "TO" , mail sending fails. - Forums

Forums

When CC or BCC has address that is in "TO" , mail sending fails.

twhite 30 Dec, 2017
Running Chromoforms 6.0.15 on Joomla 3.8.3. In globals, I have "PHP mail" chosen, but also get same result when choosing "sendmail". Platfrom host is InMotionHosting.com.

After Form submit, there is email action after a successful "Curl". An email is sent to the form submitter. Static CC and/or BCC are set in the Email action. If the email address in the "TO" field is also set in email action as CC or BCC then the send fails, with "PHP mail" or "Sendmail" configured. As long as "TO" email is not listed in "CC" or "BCC" then sending is successful.

Evidently "SMTP" configuration works on my localhost, but "PHPmail" or "sendmail" doesn't work on server. Any further information I can give please let me know.

thanks


[email21] => Array
        (
            [recipients] => Array
                (
                    [0] => p@gmail.com
                )

            [subject] => GVP Corrections Entry
            [body] => <h2>GVP Editorial Revision Tracking</h2>
<h3>* Submission completed *</h3>
<p><strong>Thanks for your input!</strong></p>

<table width="100%" cellpadding="5" cellspacing="3" border="0" class="ui table"><tr><td width="30%" valign="top" align="right"><strong>Name:</strong></td><td width="70%" valign="top" align="left">Joe Test</td></tr><tr><td width="30%" valign="top" align="right"><strong>Email:</strong></td><td width="70%" valign="top" align="left">p@gmail.com</td></tr><tr><td width="30%" valign="top" align="right"><strong>Verify Email:</strong></td><td width="70%" valign="top" align="left">p@gmail.com</td></tr><tr><td width="30%" valign="top" align="right"><strong>Publication Title:</strong></td><td width="70%" valign="top" align="left">Butter Thief</td></tr><tr><td width="30%" valign="top" align="right"><strong>Publication Version:</strong></td><td width="70%" valign="top" align="left">ver 1</td></tr><tr><td width="30%" valign="top" align="right"><strong>Issue Title:</strong></td><td width="70%" valign="top" align="left">Just a test</td></tr><tr><td width="30%" valign="top" align="right"><strong>Issue Description</strong></td><td width="70%" valign="top" align="left">Edition: ver 1.<br />
just a test, please ignore</td></tr></table>
            [from_name] => GVP Corrections Entry
            [from_email] => webservants@XXX.com
            [reply_name] => GVP Site Admin
            [reply_email] => webservants@XXX.com
            [cc] => Array
                (
                    [0] => p@gmail.com
                )

            [result] => the Mail could not be sent.
            [var] => 
        )

Max_admin 30 Dec, 2017
Hi twhite,

I would say this is a server config and Chronoforms can not do anything about it.

Best regards
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
twhite 31 Dec, 2017
1 Likes
Hi Max,

Thanks for your quick response.
It looks like it is in joomla code:
libraries/vendor/phpmailer/phpmailer/class.phpmailer.php
around line 935. I am hitting the false return when adding "bcc" when "to" has already been added with same email as "bcc".
If you use "php mailer" you should also be able to hit it.
Basically this means if you create a form and BCC yourself in the Email action, and then submit as yourself, the Email action will fail.


 if ($kind != 'Reply-To') {
            if (!array_key_exists(strtolower($address), $this->all_recipients)) {
                array_push($this->$kind, array($address, $name));
                $this->all_recipients[strtolower($address)] = true;
                return true;
            }
        } else {
            if (!array_key_exists(strtolower($address), $this->ReplyTo)) {
                $this->ReplyTo[strtolower($address)] = array($address, $name);
                return true;
            }
        }
        return false;
    }
twhite 01 Jan, 2018
Answer
1 Likes
My solution:
In libraries/cegcore2/libs/mail.php
right before line 125, I placed the following code and tested, it works.

	// phpmailer will make lowercase but we need earlier for comparison of addresses
	$this->to = array_map( 'strtolower', $this->to );
	$this->cc = array_map( 'strtolower', $this->cc );
	$this->bcc = array_map( 'strtolower', $this->bcc );

	// take out duplicates in bcc and  then cc.
	$this->bcc = array_diff( $this->bcc, $this->to, $this->cc );
	$this->cc = array_diff( $this->cc, $this->to, $this->bcc );
Max_admin 15 Jan, 2018
Hi twhite,

Thank you for posting the solution!

Best regards
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
twhite 15 Mar, 2018
Hi Max,

It looks like this fix has not been included in Chronoforms_V6.0.17_Extension.zip.

When might it be included in future update?

thanks,
Tom
twhite 17 Jun, 2018
Hi Max, Bob,

What more evidence do you need to recognize this issue as a legitimate issue?

I have same issue when I upgraded to Version 6.0.18 .

I am hosted on latest hosting solutions with InMotionHosting.com and running latest Joomla version 3.8.8 .

My fix does work. Please let me know what more evidence you need to include it in Chronoforms 6.0.19?

thanks,
Tom
pixelhexe 18 Apr, 2019
Issue still isn't fixed. Thank you so much for your solution, Tom! I run into similar problem with dynamic to and dynamic bcc.
twhite 18 Apr, 2019
Piexlhexe, thanks for confirming that this is still outstanding bug.

What I do is save a copy of libraries/cegcore2/libs/mail.php with my fix and every time I update, I compare to new one, and then copy over my fix.

I would hope that after 16 months the fix would be included .... but I understand they must be busy with other issues...
Max_admin 19 Apr, 2019
Thank you very much, fix added to the next update!

Best regards
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
healyhatman 20 Apr, 2019
Careful with the fix though Max, how do you decide which field to strip the duplicate out of?

Also any more thoughts on the suggestion I made a while ago, to add checks and debug messages to the CF mailing action instead of just Joomla's unhelpful true/false?
Max_admin 21 Apr, 2019
1 Likes
The same code above is used, priority for the TO then BCC then CC

The action checks for empty recipients/body/subject, but other than this its not possible to get the rejection reason.

Best regards
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
pixelhexe 25 Apr, 2019
1 Likes
Thank you so much, Max!

@Tom -
in case you didn't notice yet: your fix is included in ChronoForms V 6.1🙂
This topic is locked and no more replies can be posted.