Opened 18 years ago
Closed 16 years ago
#618 closed Defect (fixed)
Inconsistency between EMAIL_FROM and EMAIL_FROM_NAME in email.inc
| Reported by: | tstrunk | Owned by: | davea |
|---|---|---|---|
| Priority: | Trivial | Milestone: | Undetermined |
| Component: | Web - Project | Version: | |
| Keywords: | patch | Cc: |
Description
In WebConfig the documentation states:
EMAIL_FROM
'from' address for emails
EMAIL_FROM_NAME
'from' name for emails
PHP-Mailer respects these options; the internal php mail command does not:
email.inc (49-50):
if (defined('EMAIL_FROM')) {
$headers = "From: ". EMAIL_FROM;
should be:
if ( defined('EMAIL_FROM') && defined('EMAIL_FROM_NAME') ) {
$headers = "From: ".EMAIL_FROM_NAME."@".EMAIL_FROM;
Otherwise by specifying for example on host: "hostnumber1.com":
EMAIL_FROM - "hostnumber2.de"
EMAIL_FROM_NAME - "correct_username"
a password retrieval mail would be mailed to: hostnumber2.de@…
Revision is 14746
Change History (4)
comment:1 Changed 18 years ago by
comment:2 Changed 18 years ago by
Ah, yes - I misunderstood the documentation there. Thanks for clearing it up.
comment:3 Changed 18 years ago by
| Keywords: | patch added |
|---|
There is still a bug; although the fix is not what you initially suggested.

EMAIL_FROMis the full email address, not the hostname.EMAIL_FROM_NAMEis the "displayed" name.It should be:
if ( defined('EMAIL_FROM') && defined('EMAIL_FROM_NAME') ) { $headers = "From: ".EMAIL_FROM_NAME." <".EMAIL_FROM.">";So that with:
It gets sent with:
I'm not too sure if
EMAIL_FROM_NAMEwould work correctly if it had an@sign, as would be common to use "Foo@Home admin"...