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.

Comments

cobadger’s picture

Patch attached.

cobadger’s picture

Status: Active » Needs review

Asking for review of submitted patch.

Status: Needs review » Needs work
cobadger’s picture

cobadger’s picture

Status: Needs work » Needs review
cobadger’s picture

Sorry; updated patch again.

Status: Needs review » Needs work
cobadger’s picture

cobadger’s picture

Status: Needs work » Needs review

Patch finally passes simplytest.me testing. I'm learning.

zekvyrin’s picture

I 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

damienmckenna’s picture

damienmckenna’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
cobadger’s picture

Status: Needs review » Reviewed & tested by the community

Tested patch #12 successfully.

wundo’s picture

Status: Reviewed & tested by the community » Fixed

  • wundo committed f63c771 on 7.x-1.x authored by DamienMcKenna
    Issue #2309875 by COBadger, DamienMcKenna: Error in 'from' using site-...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

blart’s picture

Status: Closed (fixed) » Needs work
damienmckenna’s picture

Status: Needs work » Closed (fixed)

Lets handle the bug in the new issue.