Hi all,

i'm new to drupal and i've got working problems with Og mailinglist:
The installation seems to work fine (i have meticulously followed the instructions), but when i want to create a mailinglist, i've got an exception:

Fatal error: Uncaught exception 'phpmailerException' with message 'Could not instantiate mail function.' .............
C:\xampp\htdocs\drupal\modules\og_mailinglist\phpmailer\class.phpmailer.php on line 687

obviously the post is create but the email was not sent.

I've tried many ways to solve that issue, but none of them seems to work.
I figured is a phpmailer module problem (maybe multiple copies of phpmailer folder into different modules directories), so my questions are:

Is there a way to share a single phpmailer folder (maybe that one into the phpmailer module installed) between these modules?

Comments

letapjar’s picture

could you provide some info on what kind of hosting environment you are on (shared host, dedicated server etc.)

The Dev version will check libraries if you are using the libraries module for phpmailer - and if not, it will use the version in the phpmailer directory under og_mailinglist.

since the exception is coming from phpmailer - og_mailinglist is finding the file just fine - the problem is in instantiation of the PHPMailer object.

More info about your setup will help clarify why the error is occuring.

delfinocurioso’s picture

Sure, thanks for the reply

I'm under Xampp on windows vista, with an hmailer mail server.
i'm running apache 2.2, with php 5.3.1 (with pear installed also with mimeDecode)
also i've tested smtp with other drupal modules such as phpmailer and smtp and they work fine.

letapjar’s picture

I'm not familiar with hmailer so I can't really guide there.

line 687 of phpmailer throws that exception if it found no addresses in either the To, CC or BCC fields for the email in question.

Also note, my comment in post #1 above is inaccurate - the phpmailer class instantiated just fine - it's the MailSend() function that is having the problem - they have an ambiguous error message.

letapjar’s picture

Kyle,

Where does OGM explicity set which mailer is being used? The og_mailinglist_creater_mailer() function just creates the phpmailer class - which would set it to use 'mail' by default if I understand the code correctly?

howe does one tell it to use smtp or some other mailer?

kyle_mathews’s picture

Hey delfinocurioso,
Right now OG Mailinglist doesn't provide any support for setting up advanced configurations of PHPMailer such as SMTP. We've thought about supporting the installation of the PHPMailer module which provides support for setting up more advanced PHPMailer configurations. See this comment http://drupal.org/node/925928#comment-3519708

You might want to look at #911974: Send all emails through PHPMailer removing dependency on having a Sendmail compatible server as well as receiving emails through OG Mailinglist doesn't work on Window's right now due to the Sendmail-compatible server requirement (though you should be able to send emails just fine once you figure out the SMTP).

delfinocurioso’s picture

Thank you Kyle for the explanation.

Still i'm little confused about the "correct way of working" of this module (wich is nice and useful).
There's no problem to drop down the smtp usage, but i'm worried about the last statement you posted:

'receiving emails through OG Mailinglist doesn't work on Window's right now due to the Sendmail-compatible server requirement (though you should be able to send emails just fine once you figure out the SMTP).'

Because actually i don't need to send only single email, but create a broadcast system between subscribers of one group and allow to exchange messages under a single email alias (wich is what OG-mailinglist do, i understand).

So without sendmail there's no way to use this module in windows platforms?
I 'm forced to apply patches as in the post you linked me?

It seems so strange...... as i say before i thought it was a problem of duplicates class.phpmailer.php and class.smtp.php in various modules installed

kyle_mathews’s picture

Right, receiving email on OG Mailinglist doesn't work on Windows right now. I developed the module originally on Linux and used some linux-only features to speed up the development. We're trying to rework those linux-only parts right now so it'll work on Windows as well but that's not done yet. But the module should work just fine right now for sending out emails for posts created on your Drupal site.

boabjohn’s picture

Priority: Normal » Major

Just bumping this one and noting that (if it's the same problem) it is appearing also on an Ubuntu system with a different MTA:

Fatal error: Uncaught exception 'phpmailerException' with message 'Could not instantiate mail function.' in /home/../drupal/sites/all/modules/og_mailinglist/phpmailer/class.phpmailer.php:687

Stack trace:
#0 /home/../drupal/sites/all/modules/og_mailinglist/phpmailer/class.phpmailer.php(578): PHPMailer->MailSend('Date: Wed, 13 A...', '--b1_bce992b71c...')
#1 /home/../drupal/sites/all/modules/og_mailinglist/og_mailinglist_phpmailer.inc(132): PHPMailer->Send() #2 /home/../drupal/sites/all/modules/og_mailinglist/og_mailinglist.module(356): og_mailinglist_send_node_email(Object(stdClass))
#3 /home/../drupal/modules/node/node.module(679): og_mailinglist_nodeapi(Object(stdClass), 'insert', NULL, NULL)
#4 /home/../drupal/modules/node/node.module(938): node_invoke_nodeapi(Object(stdClass), 'insert')
#5 /home/../drupal/ in /home/../drupal/sites/all/modules/og_mailinglist/phpmailer/class.phpmailer.php on line 687

Any advice greatly appreciated.

boabjohn’s picture

Priority: Major » Normal

As suggested by @letapjar in #3, the error message can cover a range of issues. For us the problem turned out to be that the entire Postfix server had fallen over due to a hostname change. Once we had a look int eh Postfix logs the problem was obvious.

De-escalating this issue and noting that (at least in our case) there was no problem with og_mailinglist.

kyle_mathews’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

sano’s picture

While configuring Postfix to work with OGM I run into a problem similar to the one described in this thread. I checked the mail log and there I noticed line:

postfix/sendmail[2802]: fatal: no login name found for user ID 6226

For some reason, the drupal install. directory and all children were owned by user 6226 from group 6226. The problem went away once I changed the ownership.

chown -R root:root <path to my drupal installation>

mahfiaz’s picture

Thanks for the tip, sano, I added it to a newly created pitfalls document: http://drupal.org/node/1849614