Support Forums


Go Back   68 Classifieds Forums > Help & Support > v4.1 Questions & Support

Notices

 
LinkBack Thread Tools Display Modes
Old 03-27-2009, 11:36 AM   #1
68 Classifieds Staff
 
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 4,842
Rep Power: 111
Eric Barnes is a jewel in the rough
Default How to bcc an email to admin v4.1.x

This thread is to show you how to bcc the admin in v4.1.x

I have tested the current system and it just doesn't seem possible to actually bcc the admin. We are using the phpmailer class and for bcc it says this:
Quote:
Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.
So I had to create a workaround. In this example I will be editing the userjoin file and here is what I had to do.

First find:
$to=trim($_POST['email']);

Replace with:
$to=array(trim($_POST['email']), '[email protected]');

Next open your includes/classes/kernel/Mailer.php file and find this whole function:
PHP Code:
function sendMail($to$content$vars)
{
//lots of code in here

Replace that whole thing with this:
PHP Code:
function sendMail($to$content$vars)
{
    if(
is_array($to)) {
        foreach(
$to as $k) {
            
$this->doSend($k$content$vars);
            
$this->ClearAllRecipients();
        }
    } else {
        return 
$this->doSend($to$content$vars);
    }
}
    
function 
doSend($to$content$vars)
{
    global 
$Core$class_tpl;
        
    
$this->AddAddress($to);
    if(!empty(
$vars['fromemail'])){
        
$this->From=$vars['fromemail'];
    }if(!empty(
$vars['name'])) {
        
$this->FromName=$vars['name'];
    }if(!empty(
$vars['bcc'])) {
        
$this->AddAddress=$vars['bcc'];
    }
        
    foreach(
$vars as $key => $value) {
            
//loop through the results and assign to the template
            
$class_tpl->assign($keysafeStripSlashes($value));
    }
    if(
$Core->settings['mailHTML']=="Y") {
        
$this->AltBody $class_tpl->fetch('emails/text/'.$content);
        
$this->Body $class_tpl->fetch('emails/html/'.$content);
        
$this->IsHTML(TRUE);
    } else {
        
$this->Body $class_tpl->fetch('emails/text/'.$content);
        
$this->IsHTML(FALSE);
    }
    
$this->Subject $class_tpl->get_template_vars('subject');

    if(
$this->Send()) {
        
$this->ClearAllRecipients();
        return 
TRUE;
    } else {
        return 
"Message was not sent <br />Mailer Error: " $this->ErrorInfo;
    }

__________________
Eric Barnes
68 Classifieds Developer
Please do not send me a private message asking for support. Instead use these open forums or our ticket system.

Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 05-19-2009, 09:47 AM   #2
Member
 
Join Date: Nov 2008
Posts: 35
Rep Power: 2
Isje is on a distinguished road
Default

Hi Eric,

Does this modification mean that ALL messages sent through the system will be bcc'd to the Admin?

I want only the Contact Owner messages to be copied.

Please advise.
Thanks,
Isje
__________________
Using v4.1.3 Developer
NuStyle Lime Template
Isje is offline   Reply With Quote
Old 05-19-2009, 11:38 AM   #3
68 Classifieds Staff
 
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 4,842
Rep Power: 111
Eric Barnes is a jewel in the rough
Default

This should work. Open contact.php and find:
$vars['name']=$name;

Just under it add:
$vars['bcc']='[email protected]';
__________________
Eric Barnes
68 Classifieds Developer
Please do not send me a private message asking for support. Instead use these open forums or our ticket system.

Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 05-20-2009, 01:59 AM   #4
Member
 
Join Date: Nov 2008
Posts: 35
Rep Power: 2
Isje is on a distinguished road
Default

Quote:
Originally Posted by Eric Barnes View Post
This should work. Open contact.php and find:
$vars['name']=$name;

Just under it add:
$vars['bcc']='[email protected]';
Hi Eric, I tried this, but it doesn't work
Thanks again
__________________
Using v4.1.3 Developer
NuStyle Lime Template
Isje is offline   Reply With Quote
Old Yesterday, 01:30 AM   #5
Member
 
Join Date: Nov 2008
Posts: 35
Rep Power: 2
Isje is on a distinguished road
Default

Any new suggestions guys?
__________________
Using v4.1.3 Developer
NuStyle Lime Template
Isje is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
email and email replys roamex v4 Questions & Support 0 03-04-2009 05:52 PM
Email recpt and new order email not working napes v4 Questions & Support 6 02-14-2009 04:56 AM
Email to admin when new user registers BABBSELA v3.1 Questions & Support 5 12-29-2006 11:39 AM
Copy of �contact the owner� email to admin SkGold v3.1 Suggestions and Feedback 22 11-24-2006 03:50 PM
Email Admin When Listings Change DVM v3.0 Questions & Support 4 10-11-2006 02:18 PM


All times are GMT -4. The time now is 06:51 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0