Advertisement:

Author Topic: [New Plugin] OSClass mail  (Read 33982 times)

rockitman187

  • Newbie
  • *
  • Posts: 37
[New Plugin] OSClass mail
« on: October 19, 2011, 02:02:25 am »
Updated 5-15-2012

I have updated the files and uploaded here.


 
« Last Edit: May 15, 2012, 09:59:28 pm by rockitman187 »

_CONEJO

  • Administrator
  • Hero Member
  • *****
  • Posts: 4689
Re: Admin email all user plugin
« Reply #1 on: October 19, 2011, 10:59:56 am »
Hi rockitman187,

What is the exact problem?

HTML content is enabled by default. If you look at oc-includes/osclass/utils.php function "osc_sendMail" (around lines 230-290) you should find  "$mail->IsHTML(true) ;" which specify that the email could have some HTML content.

You also need to fill the 'body' variable with the HTML content and 'alt_body' WITHOUT HTML (htmlstriptags could do the trick).

So, could it be a problem of enconding? tinyMCE pre-parse HTML content
How are you receiving the emails? without any HTML tags? only a few? with strange characters?
Does your email support HTML content?

Could you PM your plugin so I could test it? We're very interested in your plugin, so it you plan to release it to the public for free we could help you and offer "official" support for it.


Thanks.

BuySellAndSwap

  • Sr. Member
  • ****
  • Posts: 389
Re: Admin email all user plugin
« Reply #2 on: October 19, 2011, 05:17:29 pm »
When will the plugin be reqady to use?

Thank you

RajaSekar

  • Hero Member
  • *****
  • Posts: 791
  • ராஜசேகர்
Re: [New Plugin] Admin email all user plugin
« Reply #3 on: October 21, 2011, 09:52:13 am »

why we need to modify osclassmail.php

use this to get db connections

$conn = getConnection();

use this for table prefix

$conn->osc_dbExec("select * from %s",DB_TABLE_PREFIX,$table);

rockitman187

  • Newbie
  • *
  • Posts: 37
Re: [New Plugin] Admin email all user plugin
« Reply #4 on: October 21, 2011, 10:59:14 am »
Thanks everyone, I'll have updated it an added it to the first post.
« Last Edit: October 22, 2011, 07:58:15 am by rockitman187 »

mortalkiller

  • Newbie
  • *
  • Posts: 14
Re: [New Plugin] [UPDATED] Admin email all user plugin
« Reply #5 on: October 27, 2011, 06:46:33 pm »
"There was a problem adding the plugin"

When I try install :S

BuySellAndSwap

  • Sr. Member
  • ****
  • Posts: 389
Re: [New Plugin] [UPDATED] Admin email all user plugin
« Reply #6 on: October 28, 2011, 02:15:40 am »
i also have the same error if you can help please?

thank you

rockitman187

  • Newbie
  • *
  • Posts: 37
Re: [New Plugin] [UPDATED] Admin email all user plugin
« Reply #7 on: October 28, 2011, 02:30:32 am »
Did you get it installed?

If not, what is the error you are getting? 

BuySellAndSwap

  • Sr. Member
  • ****
  • Posts: 389
Re: [New Plugin] [UPDATED] Admin email all user plugin
« Reply #8 on: October 28, 2011, 02:41:31 am »
No tried twice and said there was a problem

rockitman187

  • Newbie
  • *
  • Posts: 37
Re: [New Plugin] [UPDATED] Admin email all user plugin
« Reply #9 on: October 28, 2011, 03:48:29 am »
Are you unzipping and copying the osclass mail folder to the plugin folder or trying to load it from admin as a zip file?

If it is the zip method, try to unzip it first and copy the folder to the plugin folder and then go to admin and click install.

BuySellAndSwap

  • Sr. Member
  • ****
  • Posts: 389
Re: [New Plugin] [UPDATED] Admin email all user plugin
« Reply #10 on: October 29, 2011, 02:47:05 am »
Ok thank you i'll do it that way

steveh

  • Premium
  • Newbie
  • *****
  • Posts: 22
Re: [New Plugin] [UPDATED] Admin email all user plugin
« Reply #11 on: November 11, 2011, 09:28:49 pm »
This would be a really useful plugin but does it actually work?  It sends an email to the admin, but doesn't seem to send to the other users.  On further investigation there seems to be a critical problem - not really the fault of the plugin:

osclassmail.php calls osc_send_mail with the parameter 'add_bcc' which seems reasonable until you look at the code of osc_send_mail line 258 of utils.php contains:
Code: [Select]
        if ( isset($params['add_bbc']) ) $mail->AddBCC($params['add_bbc']);
Note 'add_bbc' not 'add_bcc'.

I tried changing the parameter name in osclassmail to add_bbc, but then I get no email sent at all.  Looking at the phpmailer documentation, I'm not sure using AddBCC to add a string separated by commas is correct either.

If this does work (and I can't see how, unless the bug's been fixed somewhere) what am I doing wrong?

Steve.

rockitman187

  • Newbie
  • *
  • Posts: 37
Re: [New Plugin] [UPDATED] Admin email all user plugin
« Reply #12 on: November 11, 2011, 09:46:32 pm »
The way it is setup it will always send an email to admin, and a blind copy to everyone else, Try to put the code back to original, set up a second account and then send an email, The email should say from and to admin, but if you look at the details it will say who it was really sent too.

Let me know if it still doesn't work for you

Thanks, Randy

steveh

  • Premium
  • Newbie
  • *****
  • Posts: 22
Re: [New Plugin] [UPDATED] Admin email all user plugin
« Reply #13 on: November 12, 2011, 03:40:33 pm »
Hi Rockitman, having completely confused myself with emails everywhere and different versions, I reloaded your original version of osclassmail and osclass utils.php from version 2.3.3.  I then set up several separate email accounts and registered them as users on my test site.  The test site is running on Windows and using a remote SMTP mail server.

With this set up the email definitely only went to the admin email, not to the users. This makes sense because osclassmail loads the user addresses into a string for the parameter 'add_bcc' for the call to osc_send_mail, while (and I presume this is an error) osc_send_mail looks for the parameter 'add_bbc' (note the misspelling).

I then changed the parameter name in osclassmail to 'add_bbc' and with this set up no email at all gets sent.  I think this is because phpmailer expects the AddBCC method to be called for each individual address, not with a string of addresses, although it is possible this works with some mail options (i.e. not SMTP mail) - I've not used phpmailer before so have no experience of what does and doesn't work.

To fix this, I've made a change in utils.php as follows.  Replace line 258
Code: [Select]
if ( isset($params['add_bbc']) ) $mail->AddBCC($params['add_bbc']);with
Code: [Select]
        if ( isset($params['add_bcc']) ) {
        $bcc = explode(',', $params['add_bcc']);
        foreach ($bcc as $b ) {
        $mail->AddBCC($b);
        }
        }
This definitely works in my setup, so I would say its a bug in osc_send_mail.  I'm going to take a look at Osclass 2.3 to see if its already been fixed.

Steve.

steveh

  • Premium
  • Newbie
  • *****
  • Posts: 22
Re: [New Plugin] [UPDATED] Admin email all user plugin
« Reply #14 on: November 12, 2011, 10:36:34 pm »
Hi, I have SMTP authentication switched on so osc_send_mail calls IsSMTP which has the effect of setting $Mailer to SMTP.  Anyway with the changes above it is working, so I think I'm going to leave it at that for now and get back to what I should be doing !

Thanks for your suggestions,
Steve.