Mailer Error: Could not instantiate mail function.

Once you've installed phpList Version 2... ask questions here!
Forum rules
Please help the volunteers to help you by supplying the version of phpList you are using, browser & version and if possible, a link to your phpList installation. This is for Version 2 of phpList (the orange one).

Mailer Error: Could not instantiate mail function.

Postby BeauSanders » 9:55pm, Thu 27 Sep, 2012

I am attempting to config phplist on CentOS 6.3. I have installed PHP and php-PHPMailer packages.

Postfix is configured and sending email correctly.

When I send a Test Message from phplist I get a "Mailer Error: Could not instantiate mail function.: error message.

I am sure that others have experienced this problem. Please point me to instructions on how to correct this issue.

Thank you in advance for your help.

-Beau
BeauSanders
phpLister
 
Posts: 8
Joined: 12:37pm, Wed 28 Apr, 2010

Re: Mailer Error: Could not instantiate mail function.

Postby duncanc » 8:08am, Fri 28 Sep, 2012

One cause of the error is that the From address is invalid.

In php.ini do you have the correct path for the sendmail command?

If you have access to the postfix logs then they should provide an indication of what is going wrong.
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: Mailer Error: Could not instantiate mail function.

Postby BeauSanders » 9:06pm, Fri 28 Sep, 2012

Thank you for your reply.

I did not point out in my first post that CentOS6.3 is running on a VMWare esxi server. I have installed all of the pear modules I can, as well as checked all of the PHP settings. Everything looks like it is to spec. Since my first email I have done a second clean, "out of the box" installation. I get the same results on it.

I even did a clean install on another physical server running RHEL6 and it worked first try.

I have changed the email addresses to all point to [DOMAIN]. The [DOMAIN] setting is for the local server which is successfully using Postfix that relays to our email firewall.

I cannot send any email with phplist...test message or to a list.

Any help will be creatly appreciated.

-Beau
BeauSanders
phpLister
 
Posts: 8
Joined: 12:37pm, Wed 28 Apr, 2010

Re: Mailer Error: Could not instantiate mail function.

Postby duncanc » 9:29pm, Fri 28 Sep, 2012

Did you look in the postfix log files?

From a command line, run the same command that php runs (check that this is the command for sendmail_path in your php.ini file), and use the same From address that phplist will use:

sendmail -i -t
From: xxxx
To: yyy

the body of the message
CTRL-D
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: Mailer Error: Could not instantiate mail function.

Postby BeauSanders » 10:00pm, Fri 28 Sep, 2012

I really appreciate your quick response to my posts. Your suggestion to look at the Postfix logs was spot on.

I have corrected the problem...SELinux was blocking Apache from using sendmail (postfix). Here is the way I corrected the issue:

1. Log in to CentOS as root
2. Look at /var/log/maillog while attempting to send a test message
3. Look at the bottom of the log for: fatal: chdir /var/spool/postfix: Permission denied
4. Enter: getsebool httpd_can_sendmail
5. It should report off per the error above: httpd_can_sendmail --> {on|off}
6. Enter: setsebool -P httpd_can_sendmail 1 {this command will take a while to run)
7. Check again: getsebool httpd_can_sendmail
8. This time it should report: httpd_can_sendmail --> on

I got most of this from a post on the SMF Simple Machines Forum...so thanks to those guys for helping. I hope this post saves some other folks some time. My new motto is "Never under estimate how annoying SELinux can be!"

Thanks.
BeauSanders
phpLister
 
Posts: 8
Joined: 12:37pm, Wed 28 Apr, 2010

Re: Mailer Error: Could not instantiate mail function.

Postby alextoti » 1:49pm, Mon 01 Jul, 2013

My friend, this reply saved my day! 8)
That was great.
I had this problem (Mailer error: Could not instantiate mail function) in my CentOS 6.4 virtual machine, and was going nuts!!!
I really don't understand anything about PHP, and this reply with the commands helped me and solved this problem.
Damn SELinux!!! F*** that :evil: .

Thank you very much!!!
:D
alextoti
phpList newbie
 
Posts: 1
Joined: 1:37pm, Mon 01 Jul, 2013

Re: Mailer Error: Could not instantiate mail function.

Postby rotech » 8:06pm, Thu 08 Aug, 2013

Thanks from me too!
:D
this one had me going in circles . googling for MORE THAN AN HOUR...
rotech
phpLister
 
Posts: 9
Joined: 8:03pm, Thu 08 Aug, 2013

Re: Mailer Error: Could not instantiate mail function.

Postby YosepTito » 11:38am, Mon 02 Dec, 2013

Thanks to you BeauSanders !!
I search in many suggestion in many topic but not success.
Very simple !!
Thank You Again :D
YosepTito
phpList newbie
 
Posts: 1
Joined: 11:33am, Mon 02 Dec, 2013


Return to Question & Problems - after installing

Who is online

Users browsing this forum: Bing [Bot] and 6 guests

cron