vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Change PM Default Email Address (https://vborg.vbsupport.ru/showthread.php?t=275939)

wayne.richards@ 12-24-2011 10:07 PM

Change PM Default Email Address
 
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!

kh99 12-25-2011 11:35 AM

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

Quote:

Originally Posted by kh99 (Post 2280858)
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:

kh99 12-25-2011 09:28 PM

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):

Code:

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?

kh99 12-25-2011 11:20 PM

Quote:

Originally Posted by wayne.richards@ (Post 2280985)
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.


All times are GMT. The time now is 10:27 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01008 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete