Author Topic: Could not instantiate mail function.  (Read 650 times)

chuck

  • Confirmed Member
  • **
  • Posts: 7
  • Karma: +0/-0
Could not instantiate mail function.
« on: March 09, 2017, 04:01:43 PM »
Upon creating a new member, I get the error message: Could not instantiate mail function.

Any recommendations?

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 3005
  • Karma: +210/-7
    • Maverick Webworks
Re: Could not instantiate mail function.
« Reply #1 on: March 09, 2017, 04:21:33 PM »
This is a default message included in the script's phpmailer. Basically what it means is that the confirmation email can't be sent.

I get this same message on my local wamp development server, but my wamp server does't have the mail function and isn't capable of sending out mail. However when installed on my host server I don't get this message, therefore you're most likely either using a localhost server on your PC or your host sever's mail function may not be functioning properly.

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

chuck

  • Confirmed Member
  • **
  • Posts: 7
  • Karma: +0/-0
Re: Could not instantiate mail function.
« Reply #2 on: March 10, 2017, 10:28:47 AM »
Thanks for the reply.

It is installed on a hosting company's server, not my local. Same server fires off Wordpress plugin / widget emails e.g. contact forms, security alerts, etc. Since I am not familiar with phpmailer I do not know if the WP emails are a legit comparison but it's all I got.

I can always check with hosting company but I'd like to learn to fix it if possible.

chuck

  • Confirmed Member
  • **
  • Posts: 7
  • Karma: +0/-0
Re: Could not instantiate mail function.
« Reply #3 on: March 10, 2017, 10:48:31 AM »
One more thing I should've mentioned.

Etano is installed on a non-production cpanel. This means the current url is IP address/~user.  The current website live is loading from a different server, using the URL the app will ultimately be on.
Etano will be added to the live site once all edits are complete and ready. I say all this to say that using the domain email (xxxxx@mysite.com) is not possible on the dev server.

If I wait to set up the domain email in the settings upon taking live on the proper url, then the phpmailer should function? (assuming the hosting provider supports php mail)

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 3005
  • Karma: +210/-7
    • Maverick Webworks
Re: Could not instantiate mail function.
« Reply #4 on: March 10, 2017, 03:04:31 PM »
Well it can't send emails because there's no domain configured to your site, and in order to send emails there needs to be an email address setup and attached to the domain. Emails must be sent "from" an email address.

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

chuck

  • Confirmed Member
  • **
  • Posts: 7
  • Karma: +0/-0
Re: Could not instantiate mail function.
« Reply #5 on: March 31, 2017, 11:26:41 AM »
Everything is now set up on production and the message still occurs even with the domain email address (email is tested and working fine).

I'd rather not go through the trouble of smtp, so i have been working with the hosting company (inmotion) to resolve.  They cannot resolve and gave me this error message in hopes someone knows what may be going on. They did set up a php.ini file and reassured me that php mail should work.

error:
[Fri Mar 31 09:53:08.867640 2017] [:error] [pid 572828:tid 139756088116992] [client 76.120.17.155:41579] sh: -t: command not found, referer: https://.../contact.php

Any thoughts? thanks!

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 3005
  • Karma: +210/-7
    • Maverick Webworks
Re: Could not instantiate mail function.
« Reply #6 on: March 31, 2017, 03:39:19 PM »
Quote
[Fri Mar 31 09:53:08.867640 2017] [:error] [pid 572828:tid 139756088116992] [client 76.120.17.155:41579] sh: -t: command not found, referer: https://.../contact.php
I'm not familiar with this error but it's a server related error.

Also check what PHP version your site is running, Etano can only function properly on PHP versions 5.3 to 5.5.


Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

chuck

  • Confirmed Member
  • **
  • Posts: 7
  • Karma: +0/-0
Re: Could not instantiate mail function.
« Reply #7 on: March 31, 2017, 04:01:17 PM »
Thanks for replying. I did change the PHP back to 5.3 from 5.6. Still get the error upon registration and contact form.

The admin emails notifying of new member fire but not the registration or contact. The seemingly is running successful every 5 minutes.

So the server is capable and everything seemingly is set up correctly, but no luck.

Is there a way to change code so the registration email to users go through the same dsb_queue_email so that get sent with the others?

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 3005
  • Karma: +210/-7
    • Maverick Webworks
Re: Could not instantiate mail function.
« Reply #8 on: March 31, 2017, 07:19:37 PM »
Quote
The admin emails notifying of new member fire but not the registration or contact.
Email notifications that the admin receives regarding new members is a bit different than the email used to communicate with members (emails sent to members).

In the admin "Setting & Options" sections you have 2 fields you can enter your email address.

Email address used to communicate with members (The email address used here must be an active email address that matches your domain.)

Send alerts to this email address (Any active email address can be used here, including a gmail address.)

Quote
Is there a way to change code so the registration email to users go through the same dsb_queue_email so that get sent with the others?
Sorry but I'm not about to try and create custom hacks to the code to try force things to work on your server, and it's doubtful that it will work properly anyway.

Either you have set the email address wrong in the admin, or there's a problem with your host. I'm leaning more towards it being an issue with your host.

I've recently dealt with issues with inmotion hosting. A friend of mine was using them (for years) and was suddenly experiencing all kinds of problems including confirmation emails not being sent, I told him that it sounds like your cron jobs weren't functioning properly. He said the host looked into it and assured him the cron jobs were configured and functioning properly. Well when I went into his cron jobs settings and set an email address to send cron reports and all I got were weird errors. I also discovered that the permissions for main cron.php file had been disabled, and this rarely happens by chance or accident and had been manually done. But even when I reset the permissions the crons still didn't function properly, even though they still insisted they were, and of course blamed the Etano script and to contact the script developers, which is often a typical response I see. If the problem is with the Etano script why does it work for most everyone else.

Well I went and setup the cron jobs through a 3rd party cron service (EasyCron.com) and low and behold they magically started working and confirmation emails were being sent again. So what does that tell you??

I don't know if the issue is with your cron jobs or not but the error they gave you suggests it could possibly be something more, such as php.ini file that's missing or not set properly. Unfortunately I can't fix hosting and server issues nor can I try adapting the code to try compensating for hosting issues. About all I can suggest is to try and get your host to fix the issue and if they can't or won't, seek different hosting that properly supports the script.




Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

chuck

  • Confirmed Member
  • **
  • Posts: 7
  • Karma: +0/-0
Re: Could not instantiate mail function.
« Reply #9 on: April 01, 2017, 01:19:34 PM »
Yes, both email fields have been set with functioning emails (with proper domain).

I can try 3rd party cron service. Or just move server companies.  Which one definitely works??? Please do provide a suggestion as Inmotion claims to support Etano.

If it is helpful to know.... Prior to my last comment, yes, inmotion says it is the code.  They did set up the php.ini, plus they say the cron is supported. If I had something to dispute these comments, I would. But after all the tickets and chat they insist it is code issue. 
For whatever reason, inmotion does provide the Etano script to customers like me - just like WordPress - to install and use. So i have installed for a client, and now I have a blocking issue and as your example indicates it is likely inmotion's fault.  GoDaddy does not provide Etano as it is not compabitable unless VPS or dedicated server. Seems inmotion is providing the script but not supporting its use. I do not mind to request for them to remove the script from their options. Just a thought to save others troubleshooting time and make their Etano user experience way better.


bobokop

  • Confirmed Member
  • **
  • Posts: 14
  • Karma: +0/-0
Re: Could not instantiate mail function.
« Reply #10 on: July 31, 2017, 10:08:23 PM »
Same trouble's happening to me. Ive filled both sections "Site Option > mail address used to communicate with members" with my existing webmail and  site option > Send alerts to this email address" with my gmail account.

Php.ini content :
[PHP]
safe_mode = Off
register_globals = Off
magic_quotes_gpc = Off
magic_quotes_runtime = Off

[Session]
session.use_cookies = 1
session.use_trans_sid = 0


Cron job every 5 minutes.

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 3005
  • Karma: +210/-7
    • Maverick Webworks
Re: Could not instantiate mail function.
« Reply #11 on: July 31, 2017, 11:01:44 PM »
Well as mentioned already in the above posts, the problem is most likely with your host. Your host must support phpmailer mail function. Although not very common, some low level hosting only supports SMTP.

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

bobokop

  • Confirmed Member
  • **
  • Posts: 14
  • Karma: +0/-0
Re: Could not instantiate mail function.
« Reply #12 on: August 01, 2017, 01:34:12 AM »
Ok, so i better turn off the mail activation on member registration then, how to do it ?

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 3005
  • Karma: +210/-7
    • Maverick Webworks
Re: Could not instantiate mail function.
« Reply #13 on: August 01, 2017, 06:26:51 AM »
You can find instructions on how to do it here ...
http://www.maverickwebworks.com/free.html

Look for ...
Auto Activate Members at Registration Mod

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

bobokop

  • Confirmed Member
  • **
  • Posts: 14
  • Karma: +0/-0
Re: Could not instantiate mail function.
« Reply #14 on: August 01, 2017, 11:31:27 PM »
Great, thanks a bunch.