View Full Version : Change PM Default Email Address
wayne.richards@
12-24-2011, 10:07 PM
Is there any way i can change the address that PM's appear to come from without changing the default email address used by contact us etc?
It doesnt matter how many times i put "DO NOT REPLY TO THIS EMAIL" in the pm notification mail sent out to members i still get loads of replies in my inbox!
If you look at includes/functions.php there's a function named vbmail() that has a $from parameter so you can specify from address. You can put an address as the default for that parameter and it will be used for all emails sent, or you can find the calls to vbmail() used for private messages (in includes/class_dm_pm.php), and add the "from" parameter there.
wayne.richards@
12-25-2011, 08:13 PM
If you look at includes/functions.php there's a function named vbmail() that has a $from parameter so you can specify from address. You can put an address as the default for that parameter and it will be used for all emails sent, or you can find the calls to vbmail() used for private messages (in includes/class_pm_dm.php), and add the "from" parameter there.
Any idea what the line would look like in "class_pm_dm.php" as i cant seem to find any reference to mail in there. :confused:
Sorry, it's actually class_dm_pm, but you probably figured that out...
Anyway, there's this code around line 589 (in version 4.1.9):
if (($user['options'] & $this->registry->bf_misc_useroptions['emailonpm']) AND $user['usergroupid'] != 3 AND $user['usergroupid'] != 4)
{
$touserinfo =& $user;
$plaintext_parser->set_parsing_language($touserinfo['languageid']);
$plaintext_message = $plaintext_parser->parse($this->fetch_field('message'), 'privatemessage');
eval(fetch_email_phrases($email_phrases['pmreceived'], $touserinfo['languageid'], '', 'email'));
vbmail($touserinfo['email'], $emailsubject, $emailmessage, false, 'no_reply@foo.com');
}
That sends the "you have a pm" email. I added the part in red (the 'false' is another default parameter that comes before the from address).
wayne.richards@
12-25-2011, 10:58 PM
I guess i replace with the "no_reply@foo.com" the email i want it to appear email come from?
I guess i replace with the "no_reply@foo.com" the email i want it to appear email come from?
Yeah, sorry, I should hav mentioned that. I was using that for testing but you can put anything you want there.
wayne.richards@
12-26-2011, 04:23 PM
Superb! have done it and its working a treat, now if anybody answeres the PM notification email they get a response telling them.
Thanks very much for all your help, you have prevented me getting anymore headaches from stupid users.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.