修改Mediawiki发送邮件的头信息

Home > Wiki支持, 今日一点 > 修改Mediawiki发送邮件的头信息

算是前几天说的“STSGMassMailer助Mediawiki邮件群发”的补充吧,为啦群发邮件时,接收者不能看到其他接收者的邮件地址信息,才想这样隐藏的..

效果图。

修改的mediawiki的文件,不推荐修改以免给以后造成不必要的麻烦

原代码

$headers =
“MIME-Version: 1.0$endl” .
“Content-type: text/plain; charset={$wgOutputEncoding}$endl” .
“Content-Transfer-Encoding: 8bit$endl” .
“X-Mailer: MediaWiki mailer$endl”.
‘From: ‘ . $from->toString();

修改后的代码

$headers =
“MIME-Version: 1.0$endl” .
“Content-type: text/plain; charset={$wgOutputEncoding}$endl” .
“Content-Transfer-Encoding: 8bit$endl” .
“X-Mailer: MediaWiki mailer$endl”.
“To:abc$endl”.
“From:def “;

在include/usermailer.php的行171——行176位置,若想把所有发送出去的邮件头都自定义修改的话可以找找上边还有一处,修改成自己想要的就可以啦。每行的结束是以”$endl”结束的,这点需要注意。

不明白的可以对比截图内容。。

如果只是为啦群发邮件可以参考mail函数直接发送。。

< ?php
$message=”测试ing”;
mail(“wiki@192.168.1.6″, “测试啊”, $message, “From: wiki2@192.168.1.6\nReply-To: wiki2@192.168.1.6\nX-Mailer: PHP”);
?>

转载原创文章请注明,转载自:[Lin's Space|Only]

本文链接: http://clin003.com/wiki/mediawiki-mail-header-1196/

Google比较注重原创性和时效性,若没有找到需要的内容可尝试以下搜素。

This entry was posted in Wiki支持, 今日一点 and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>