Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
7957c9fb
Commit
7957c9fb
authored
Dec 22, 2008
by
Richard Mansfield
Browse files
Add moodle hack to phpmailer to allow custom Message-ID header
parent
dc2c3702
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/phpmailer/class.phpmailer.php
View file @
7957c9fb
...
...
@@ -799,7 +799,45 @@ class PHPMailer
if
(
$this
->
Mailer
!=
"mail"
)
$result
.
=
$this
->
HeaderLine
(
"Subject"
,
$this
->
EncodeHeader
(
trim
(
$this
->
Subject
)));
$result
.
=
sprintf
(
"Message-ID: <%s@%s>%s"
,
$uniq_id
,
$this
->
ServerHostname
(),
$this
->
LE
);
/**
* BEGIN original phpmailer code
*
* Commented out is the original line we are replacing.
* Vy-Shane Sin Fat <vy-shane At moodle.com>, 14 Feb 2007.
*/
//$result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE);
/**
* END original phpmailer code
*/
/**
* BEGIN custom Moodle code
*
* This change is made necessary by MDL-3681. The Moodle forum module
* adds Message-ID as a custom header for each forum post mailout.
* This is used to help email clients display the messages in a
* threaded view. However, phpmailer also adds it's own Message-ID
* to every email that it sends. We want this to happen only if we
* haven't defined our own custom Message-ID for the email.
*
* Vy-Shane Sin Fat <vy-shane At moodle.com>, 14 Feb 2007.
*/
$needmessageid
=
true
;
for
(
$i
=
0
;
$i
<
count
(
$this
->
CustomHeader
);
$i
++
)
{
if
(
strtolower
(
trim
(
$this
->
CustomHeader
[
$i
][
0
]))
==
'message-id'
)
{
$needmessageid
=
false
;
break
;
}
}
if
(
$needmessageid
)
{
$result
.
=
sprintf
(
"Message-ID: <%s@%s>%s"
,
$uniq_id
,
$this
->
ServerHostname
(),
$this
->
LE
);
}
/**
* END custom Moodle code
*/
$result
.
=
$this
->
HeaderLine
(
"X-Priority"
,
$this
->
Priority
);
$result
.
=
$this
->
HeaderLine
(
"X-Mailer"
,
"PHPMailer [version "
.
$this
->
Version
.
"]"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment