Buy Now
Sign in

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

twhite , December 30 2017
T
twhite
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] =>
)

admin
Hi twhite,

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

Best regards
Max
If your main question got answered then please mark the answer using the button!​
​Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
T
twhite
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;
}
T
twhite
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 );
admin
Hi twhite,

Thank you for posting the solution!

Best regards
Max
If your main question got answered then please mark the answer using the button!​
​Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
T
twhite
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
T
twhite
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