PHPmail and sendmail errors from ChronoForms

Malinthas 27 Aug, 2014
Chronoforms is currently unable to send messages, via sendmail or PHPmail. I get the error messages "Could not execute: /var/qmail/bin/sendmail" or "Could not instantiate mail function." respectively. The Joomla! system itself can send messages, as can other extensions. Only Chronoforms is having difficulty. It has the problem with each and every form.

I have ensured that Joomla! and all extensions are up to date. I have also verified that the From Name and From Address match between Joomla! and Chronoforms. I attempted replacing phpmail.php with earlier and modified versions. I keep getting the same error(s) regardless. Anybody have any ideas? The behavior is relatively new; I last received messages from the site about a month ago. To my knowledge, no changes were made to the Joomla! configuration or extensions in-between.
GreyHead 27 Aug, 2014
Hi Malinthas,

ChronoForms v4 uses the Joomla! mailer so there shouldn't be any problem if that is working for other components. Please drag a Debugger action into the On Submit event, then submit the form and post the debug - including the 'dummy emails' results here.

Note: if you are using the Easy Wizard you can turn on Debug on the Others tab in CFv4 or the Setup tab in CFv5.

Bob
Malinthas 28 Aug, 2014
Not sure what to post, but here's what I got:

_____
Could not instantiate mail function.

Data Array:
Array
(
[chronoform] => contact_us
[event] => submit
[Itemid] => 147
[option] => com_chronoforms
[view] => form
[first_name] => John
[last_name] => Smith
[street_address] =>
[city] =>
[state] =>
[zip_code] =>
[phone_number] =>
[email_address] => john@smith.com
[question_comment] =>
[yes_newsletter] => 1
[chrono_verification] => ZWey8
[input_submit_14] => Submit
[860f7c4b540a48e8b822a68636b11372] => 1
)

Validation Errors:
Array
(
)


Thank you for contcacting The Peacemaker Program! A member of our staff will contact you shortly.

Debug Data 1.
Core Captcha 1. Passed the core captcha check!

2.
email 1.
10 1.
ResultAn email has been SENT successfully from (Peacemaker Website Robot)info@thepeacemakerprogram.org to info@thepeacemakerprogram.org

2.
Body

First Name* John
Last Name* Smith
Street Address
City
State
ZIP Code
Phone Number
eMail Address* john@smith.com
Question/ Comment
YES! Please contact me... 1



Submitted by 208.125.236.54
3.
Attachmentsarray ( )




Powered By ChronoForms - ChronoEngine.com
Malinthas 28 Aug, 2014
It's worth noting that, even though it claims a message was successfully sent, it wasn't. The Joomla! Mass Mail function and other extensions (such as ACYmailing) both still work fine, both before and after this message was attempted.
Max_admin 28 Aug, 2014
Please try to use a different from/To addresses, you should also check your spam filter, or try different To/From email combinations!

I suggest that you use the same From email in your Mass mail.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Malinthas 28 Aug, 2014
Thanks for the reply. Hopefully I can clarify:
- I have checked the spam folders and firewall; nada. Also, mail from Mass Mail and other extensions comes through fine.
- I tried two different addresses as the "from" address, and two different destinations as the "to" address. In all cases, the Joomla! settings matched those in ChronoForms. None of them were successful from ChronoForms; all WERE successful from Mass Mail.
- Also, ChronoForms continues to show the errors mentioned above; I feel like, if a message was being sent, they wouldn't be.
Max_admin 28 Aug, 2014
Well, what's the mailing method set in Joomla global config ? please try to change it ?

Also do you have the latest v4 update ?

If this still doesn't help then here is a code fix which you can try, and please let me know the results:

Open this file:
\administrator\components\com_chronoforms\form_actions\email\email.php
line 216:
$email_sent = JUtility::sendMail($from, $fromname, $recipients, $subject, $email_body, $mode, $ccemails, $bccemails, $email_attachments, $replyto_email, $replyto_name);

change to:

$JMail = JFactory::getMailer();
$email_sent = $JMail->sendMail($from, $fromname, $recipients, $subject, $email_body, $mode, $ccemails, $bccemails, $email_attachments, $replyto_email, $replyto_name);


Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Malinthas 28 Aug, 2014
Thanks; will give that a try. As mentioned in the OP, I have tried both PHPmail and sendmail in the global config, in case there was some sort of glitch with one or the other. They both give an error, though different errors, at least. I have not tried both with debug turned on, however.
Max_admin 29 Aug, 2014
Ok, please test the code fix I suggested and let me know ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Malinthas 29 Aug, 2014
I swapped out the code as requested, with the same result, I'm afraid.
😟
GreyHead 29 Aug, 2014
Hi Malinthas,

As this is CFv4 you might want to test my Email [GH] action - it has slightly different mailer code to the standard one and should also show any errors returned from the mailer in the output.

Bob
Malinthas 03 Sep, 2014
Okay, so I tried the new mail function. I still got an error (Could not instantiate mail function) but I also got... well, a lot. Pages and pages of text. What do you need me to paste in?

If it's helpful, the first two lines are as follows:
$domain: Array ( [0] => info [1] => thepeacemakerprogram.org )
--------------------------------------------------------------------------------

$return: 1

~Mark
Malinthas 03 Sep, 2014
Hang on, I am thinking tht this portion might be the most relevant:
[] => JException Object
(
[level:protected] => 8
[code:protected] => 500
[message:protected] => Could not instantiate mail function.
[info:protected] =>
[file:protected] => /home/playin5/public_html/libraries/joomla/error/error.php
[line:protected] => 175
[function:protected] =>
[class:protected] =>
[type:protected] =>
[args:protected] => Array


My server just recently underwent maintenance. Is it possible that my version of PHP changed, or something similar?
Malinthas 03 Sep, 2014
My server currently has PHP version 5.2 installed. Which is odd, since I could have sworn it was previously 5.3, but I could be wrong. In any case, I find I can now choose which version I use, from 5.2, 5.3, 5.4, and 5.5. That's a new option my control panel did not previously have. Not sure if any of this is relevant.
Malinthas 03 Sep, 2014
:::sigh::: Sorry for multi-posting, but I'm just lost here. My control panel reports the PHP version as 5.2 but when I run PHPinfo, I get 5.4.32 instead. Anybody got any ideas?
Malinthas 03 Sep, 2014
Update: Having tried all the various flavors of PHP, no difference. The hosting company swears no changes were made, other than now requiring SMTP authentication to send messages... but other plugins can still send fine without it, so... stumped.
GreyHead 04 Sep, 2014
Hi Malinthas,

Well requiring SMTP authentication when it wasn't needed before is quite a big change.

Please check the Site Admin | Global Configuration | Server settings for the mailer and make sure that Authentication is set up there. In any case re-save these settings as there was one Joomla! bug that required this.

ChronoForms v5 also has some SMTP settings if you Click the Settings icon in the Forms Manager Toolbar - I don't know quite how these relate to the Joomla! settings or which ones CF uses (Max will know). You can try adding your settings here though.

To see which version of PHP is being uses from the Site Admin | System Info | PHP Info page. That is not always the same as the host control panel in my experience.

The output you are posting looks as though it may be from the Joomla! Debug rather than from a ChronoForms Debugger action - that should normally only post a page or so unless you have a very long/complex form.

Bob
Malinthas 04 Sep, 2014
Well, I am unable to make sendmail or PHPmail work, so I'm just using SMTP to send my mail as a workaround. I admit, that will concern me a little when it comes time to send out our quarterly newsletter, as that'a a few thousand addresses, but I suppose it is what it is.
thebrandaffect 23 Oct, 2014
Hello,

I am hoping someone can help me figure out why I am now getting an error 'could not instantiate mail function' all the sudden, when I had not changed any of the settings and was receiving the inquiries fine up until recently. I am currently on joomla 2.5.11 and have it set up as PHPmail.

-------
When I do the debugger action, here is what is shows:
Could not instantiate mail function.
Contact Us
Data Array: 
Array
(
    [chronoform] => Contact_Barre
    [event] => submit
    [Itemid] => 114
    [option] => com_k2
    [view] => itemlist
    [layout] => category
    [task] => category
    [id] => 35
    [input_text_1] => Steve Borchert
    [input_text_2] => 
 steve@thebrandaffect.com
    [input_text_3] => 
    [input_select_4] => General Inquiry
    [input_textarea_5] => Testing form submission
    [recaptcha_challenge_field] => 03AHJ_VuuS3-UbuduzH9YlmJadE0PuWofReVt1kg15ev2vWUfPPUewRsp_Yfvrbicc-U5-wtIbd5JVENdMtivOY4hLiH8Z_WP0qZbwMb5nsiysZN6xPfaYAZVz4b0XN7s7ZBd2AAgzlXF-HCmqJs-iwK1kgzBvErfXgIdk4fOJkHu1xhLABMBL5WArHJkT6fZ-2qpmwFiZhvLQksGfU9jDCNpe3HLpzOSX1w
    [recaptcha_response_field] => hemmeta whether
    [input_submit_6] => Submit
    [8c9fbcbc1d4136050aa8a2bf79b023f6] => 1
    [featured] => 1
    [limit] => 14
)
Validation Errors: 
Array
(
)
Debug Data
email
10
Result
An email has been SENT successfully from (TheBarreCollective.com) steve@thebrandaffect.com to steve@thebrandaffect.com
Body
Send an email. All fields with an * are required.
NAME*	Steve B
EMAIL*	steve@thebrandaffect.com
PHONE	
REASON FOR CONTACT*	General Inquiry
COMMENTS	Testing form submission
{ReCaptcha}
Attachments
array ( )
Thank you for your message. Someone will be in touch with you soon.


Is this something I can fix within Joomla? or do I need to verify if the hosting provider made any upgrades or changes that might affect this? I appreciate the help in advance!
Max_admin 23 Oct, 2014
Can you receive emails from Joomla itself ? did you check the spam filter ?

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
thebrandaffect 23 Oct, 2014
I looks like I get the same message from Joomla itself. i went to Users -> Mass Email and tried sending a test email to the SuperAdmin and got the same error 'Could not instantiate mail function.'

What does that mean?
Max_admin 23 Oct, 2014
You have a problem with the mail settings, or the mailing method configured in your Joomla global config doesn't work, please check with your host admin!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 23 Oct, 2014
Hi thebrandeffect,

Please see this FAQ which has some suggestions.

Bob
This topic is locked and no more replies can be posted.