Forums

Mailer Error: Could not instantiate mail function - sometimes!

Bjarne1966 13 May, 2015
Hi

I'm new to both Joomla! and Chronoforms, but have setup a homepage, where I use Chronoform for a contact page and a time booking form page - both sending emails to me.

I have 2 domains, one for test, and one for production (both hosted by one.com Denmark). The production site was made by copying the files and database from the test domain (using binary transfer in FileZilla for the file copy, and phpMyAdmin for exporting/importing the database) - and changed all links from the test to the production domain (including paths etc).


Everything works fine on the test domain - but I have a lot of problems with sending mails from Chronoform forms.

Using the production domain, I cannot send mails using Chronoforms - but it works, when I use the Joomla standard contact form.

Both the chronoform and the Joomla global configuration are identical on both servers. I'm using phpMailer, since I could not set up SMTP for one.com on any of the domains (both Joomla global config and Chronoform config).

When sending the email from the Chronoform contact form, I get the following error:
•Mailer Error: Could not instantiate mail function

I have had the error since the move from the test to the production 3-4 days, but yesterday evening I thought everything was solved - It worked!! But this morning, the error is there again!

I have used caching - and deactivated it on the 2 forms. I have now turned all caching off, and deleted cached files - no effect on the error...

Do anybody have any ideas of, what could cause the problems?
GreyHead 13 May, 2015
1 Likes
Hi Bjarne1966,

How do you have the Email action configured?

Please drag a Debugger action into the On Submit event, then submit the form and post the debug - including the 'dummy emails' results here.

Bob
Bjarne1966 13 May, 2015
Hi GreyHead

Here is the debug info:

Data Array

Array
(
    [chronoform] => Kontakt
    [event] => submit
    [name] => bjarne
    [email] => fjldj@jfdla.dk
    [phone] => 260
    [message] => asdkføa
    [bestiltid] => Send email
    [ip_address] => x.x.x.x (deleted)
)

Array
(
)



Errors

Array
(
)



Debug Info

Array
(
    [1] => Array
        (
            [Email] => Array
                (
                    [0] => An email with the details below could NOT be sent:
                    [1] => To:testfodexpert@gmail.com,  fjldj@jfdla.dk
                    [2] => Subject:Besked til Ørestad Klinik for Fodterapi
                    [3] => From name:bjarne
                    [4] => From email:fjldj@jfdla.dk
                    [5] => CC:
                    [6] => BCC:
                    [7] => Reply name:
                    [8] => Reply email:
                    [9] => Attachments:
                    [10] => Array
                        (
                        )

                    [11] => Body:
<p>Tak for din henvendelse. Klinikken har modtaget følgende besked:</p>
<p><strong>Besked:</strong></p>
<p>asdkføa</p>
<p><strong>Kontaktinformationer:</strong><br />bjarne<br />260<br />fjldj@jfdla.dk</p>
                )

        )

)
]
Bjarne1966 13 May, 2015
Some more information - after re-reading the article, calculus00 refered to (for the 100th time..) 🙂

The article states:

If you can receive emails from any of the core Joomla extensions like the core contact form or users regsitration, then please check your Joomla Global configuration settings, and make sure that the "From name" and "from email" used in the "Mail setup" match the ones used in your form's Email setup.



Both my forms uses the customers name and email as "from" - this is different from the Joomla Global config, where it is the clinics name and email that is registered.

But this works on the test domain - and yesterday also on the production domain, so I guess this has no influence, or???
Bjarne1966 13 May, 2015
Hi guys,

Thanks for helping me! 😀

I was convinced, that different "from-emails" in Joomla Global config and the forms "from-fields" was the reason, since it works fine on the test domain and sometimes on the production server.

But now I created an extra test contact form with from-names as in the global config - and the problem was gone!! :-) I hope it will not go as before, where it after some time changes...

My problem is now, that I really want the customer to be the sender - I couldn't get the dynamic reply-to adresses to work. I will look some more into it - and hopefully be able to get it to work.

Thanks again.
GreyHead 14 May, 2015
Hi Bjarne1966,

I strongly recommend that you do *not* use the Dynamic From Email element in your Email Setups. Using this often results in your emails being marked as spam and dropped into a spam filter. Instead use the static From Email with an address that matches the site domain name and use Dynamic ReplyTo Email for the user email. The result is the same but with a much better chance of good delivery.

The same thing may apply if the To and From addresses are the same (as in your Debugger code).

Please try testing with a Static From address matching the site domain.

Bob
Bjarne1966 14 May, 2015
Hi Bob

Thanks again. I have now changed my email setup, so I send 2 emails for each submit:

1. An email from the clinic (the business having the homepage) (= as configured in Joomla global config) to the customer (dynamic fields)
2. An email from the clinic to the clinic with a dynamic reply-to address (= the customers email)

Now It seem's to work - but I have before experienced that it suddenly won't work without any changes.

You write:

The same thing may apply if the To and From addresses are the same (as in your Debugger code)



I read this, as my solution for mail # 2 is bad or unstable... Could a work-around be to create a separate email for the clinic, so I send mail 2 from "clinic1" to "clinic2", and then letting my mailprovider forward all mails from clinic2 to clinic 1? Or is it the same risk?

Thanks again for all your help😀
GreyHead 14 May, 2015
1 Likes
Hi Bjame 1966,

I have before experienced that it suddenly won't work without any changes.
In my experience this doesn't happen - something somewhere has changed. Often that is a mail service changing their spam-checking rules.

The From Email doesn't have to be a 'real' mailbox. The domain should match the the site - as that is where the email is from; and it should be different from the To address. So you can use no-reply@my_domain.com or something like that. I usually use info@ or admin@

Bob
Bjarne1966 14 May, 2015
Thanks for the help. I will change mail # 2, so to and from is not the same address :-)

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