Problem/Motivation
When SMTP module is used and the site-wide contact form has multiple recipients designated, the "$from" variable is set to the value of the multiple recipient email addresses, triggering an error message ("'The submitted from address (@from) is not valid.').
The 'hack to fix reply-to issue' helps by setting a usable $reply variable, but it leaves the $from variable set as the value of the multiple email addresses.
Proposed resolution
Move the "$properfrom" section down, just after $headers['Reply-To'] is set, and set $from = $properFrom.
Patch to follow.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | smtp-n2309875-12.patch | 886 bytes | damienmckenna |
Comments
Comment #1
cobadger commentedPatch attached.
Comment #2
cobadger commentedAsking for review of submitted patch.
Comment #4
cobadger commentedUpdated patch.
Comment #5
cobadger commentedComment #6
cobadger commentedSorry; updated patch again.
Comment #9
cobadger commentedBetter?
Comment #10
cobadger commentedPatch finally passes simplytest.me testing. I'm learning.
Comment #11
zekvyrin commentedI applied the patch (also works in current dev version) and it seems to fix my issue.
Also, I'm getting the result I think it supposes to be doing in contact form:
Sender is SMTP account
Reply to is form's email
Comment #12
damienmckennaRerolled.
Comment #13
damienmckennaComment #14
cobadger commentedTested patch #12 successfully.
Comment #15
wundo commentedComment #18
blart commentedThis led to: https://www.drupal.org/node/2724331
Comment #19
damienmckennaLets handle the bug in the new issue.