AndrewRich
04-10-2012, 08:45 PM
This involves modifying the sendmessage.php file directly. If that scares you then don't do it.
I've fixed sendmessage.php such that emails sent by members from my forum now set the "reply-to" field properly, that is, to the email address of the member sending the message. This solves the long-standing problem of people replying to those messages and the replies ending up in my inbox (since the admin email address forwards to me).
It seems to me that the email system should have been set this way to begin with, but since it wasn't...
This covers the "Contact Us" form, the "Send thread to friend" menu option and the "Email Member" option.
This required three code edits in sendmessage.php:
(was)
vbmail($destemail, $subject, $message, false, $vbulletin->GPC['email'], '', $name);
(now)
vbmail($destemail, $subject, $message, false, $vbulletin->GPC['email'], "reply-to:{$vbulletin->userinfo['email']}\n", $name);
(was)
vbmail($vbulletin->GPC['sendtoemail'], $vbulletin->GPC['emailsubject'], $message);
(now)
vbmail($vbulletin->GPC['sendtoemail'], $vbulletin->GPC['emailsubject'], $message,'','',"reply-to:{$vbulletin->userinfo['email']}\n");
(was)
vbmail($userinfo['email'], fetch_censored_text($vbulletin->GPC['emailsubject']), $message , false, $vbulletin->userinfo['email'], '', $vbulletin->userinfo['username']);
(now)
vbmail($userinfo['email'], fetch_censored_text($vbulletin->GPC['emailsubject']), $message , false, $vbulletin->userinfo['email'], "reply-to:{$vbulletin->userinfo['email']}\n", $vbulletin->userinfo['username']);
Because this is a PHP code edit (not a template edit) it may and probably will be overwritten at some future time during a system upgrade. To re-do the edit, search sendmessage.php for calls to the "vbmail" function and add the "reply-to" header as the sixth argument, padding previous arguments with nulls if necessary as in the second edit above.
This won't affect notifications (e.g. DMs, thread subscriptions) because those really are sent from the system, not an individual user. DM notifications are not the actual DM, though they include the message; they are a notification from the system that a DM is available. I do get erroneous replies to those all the time and I'm open to suggestions for how they should be handled.
I've fixed sendmessage.php such that emails sent by members from my forum now set the "reply-to" field properly, that is, to the email address of the member sending the message. This solves the long-standing problem of people replying to those messages and the replies ending up in my inbox (since the admin email address forwards to me).
It seems to me that the email system should have been set this way to begin with, but since it wasn't...
This covers the "Contact Us" form, the "Send thread to friend" menu option and the "Email Member" option.
This required three code edits in sendmessage.php:
(was)
vbmail($destemail, $subject, $message, false, $vbulletin->GPC['email'], '', $name);
(now)
vbmail($destemail, $subject, $message, false, $vbulletin->GPC['email'], "reply-to:{$vbulletin->userinfo['email']}\n", $name);
(was)
vbmail($vbulletin->GPC['sendtoemail'], $vbulletin->GPC['emailsubject'], $message);
(now)
vbmail($vbulletin->GPC['sendtoemail'], $vbulletin->GPC['emailsubject'], $message,'','',"reply-to:{$vbulletin->userinfo['email']}\n");
(was)
vbmail($userinfo['email'], fetch_censored_text($vbulletin->GPC['emailsubject']), $message , false, $vbulletin->userinfo['email'], '', $vbulletin->userinfo['username']);
(now)
vbmail($userinfo['email'], fetch_censored_text($vbulletin->GPC['emailsubject']), $message , false, $vbulletin->userinfo['email'], "reply-to:{$vbulletin->userinfo['email']}\n", $vbulletin->userinfo['username']);
Because this is a PHP code edit (not a template edit) it may and probably will be overwritten at some future time during a system upgrade. To re-do the edit, search sendmessage.php for calls to the "vbmail" function and add the "reply-to" header as the sixth argument, padding previous arguments with nulls if necessary as in the second edit above.
This won't affect notifications (e.g. DMs, thread subscriptions) because those really are sent from the system, not an individual user. DM notifications are not the actual DM, though they include the message; they are a notification from the system that a DM is available. I do get erroneous replies to those all the time and I'm open to suggestions for how they should be handled.