Could not instantiate mail function error (different from others)

This forum is for reporting bugs in Joomla!. Please don't report problems with extensions in here.
Forum rules
Forum Rules
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
bleu
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Fri Jan 30, 2009 6:42 pm

Re: Could not instantiate mail function error (different from ot

Postby bleu » Tue Mar 10, 2009 6:37 pm

i used this way and it works to my site:

Goto Admin panel > Global Configuration > Server > Mail Settings > Mailer and select SENDMAIL there,instead of PHP MAIL FUNCTION

abusa1
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Fri Mar 20, 2009 6:10 am

Re: Could not instantiate mail function error (different from ot

Postby abusa1 » Tue Mar 24, 2009 8:22 pm

Here is how to change from PHP Mail Function to Sendmail:

1. Log in as an admin on the backend of your joomla ( http://localhost/ "name_of_your_site"/administrator)
2. On the menu bar (on top) go to Site > Global Configuration
3. You'll see on left side three links "Site | System | Server" (Right under "Global Configuration" phrase)
4. Click on the Server
5. Then find on your right "Mail Settings" box
6. In the Mailer drop down menu change from PHP Mail Function to Sendmail

Hope this helps

slavster
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Jul 16, 2009 1:06 am

Re: Could not instantiate mail function error (different from ot

Postby slavster » Thu Jul 16, 2009 1:10 am

Thank you, temporaryadd08. It works, but..
it doesn't send a confirmation letter, and goes to the blank page index.php/component/user/

When I go to the User Manager - I see a new user, approve the user , everything is fine, now user can enter the website.

,localhost.

thesheriff
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Tue Jul 07, 2009 8:01 pm

Re: Could not instantiate mail function error (different from ot

Postby thesheriff » Fri Aug 07, 2009 5:25 pm

I tried writing a normal mail() script on my server. It works. So no host issues. But whenver I use the php mail func in joomla. It gives me a could not instantiate error.

VooDooDoll
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Tue Oct 06, 2009 5:43 am

Re: Could not instantiate mail function error (different from ot

Postby VooDooDoll » Tue Oct 06, 2009 7:54 am

I tried everything I was reading on this forum and finally fixed it through trial error. I finally fixed it by googling aol smtp because I had an aol address. The directions were right there very similar to how you would set up the configurations for outlook express.

i followed the configurations they gave me....aol likes to use port 587 not 25...They like "user authentication" also.

Once my smtp global configurations were set...I opened up

Joomlafolder\libraries\phpmailer\smtp.php scrolled down and changed the port to match...it worked like a charm...my advice is....go to Ur email provider and find out what ports they prefer you to use then change your site\global configurations\server\mail settings to smtp and fill in the blanks as they suggest..then change your smtp.php file and you might be happy from the results...

cuz who hates wasting time!!!

Global configurations for AOL:
* Set (SMTP) mail server Host to smtp.aol.com.
* Make sure SMTP authentication is enabled for this server.
* Enter your screenname as the user name and
* your AOL screennname's password as the password.
* Make sure the SMTP server port is set to 587.
*SMTP security to 'none'

var $SMTP_PORT = 587; <----(this will be the port setting in your smtp.php file)

Acario
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Wed Jul 29, 2009 12:50 am

Re: Could not instantiate mail function error (different from ot

Postby Acario » Mon Oct 26, 2009 8:38 pm

Could not instantiate mail function error


I got this message too. Took a bit to realize I forgot to put in the Administrator email address in the JForms form I made. Works fine now. Thought I'd share this since it's something so simple I'm sure others are looking over it too.

decomo95
Joomla! Intern
Joomla! Intern
Posts: 87
Joined: Mon Apr 27, 2009 3:30 pm
Location: San Jose, California
Contact:

Re: Could not instantiate mail function error (different from ot

Postby decomo95 » Fri Oct 30, 2009 4:01 am

I got could not instantiate mail error. I followed the instruction above and changed the global config to indicate sendmail instead of phpmail. Now instead of getting the instantiate error, I got this new error:

PHPMAILER_EXECUTE/usr/sbin/sendmail

any idea why?

thanks.
http://www.drugzoo.com
Helping Consumers Reduce Drug Costs
http://Zlancer.com
Connecting Buyers and Freelancers to get projects completed.

mshoaib
Joomla! Apprentice
Joomla! Apprentice
Posts: 38
Joined: Tue Nov 10, 2009 4:09 pm

Re: Could not instantiate mail function error (different from ot

Postby mshoaib » Fri Nov 13, 2009 9:36 am

Well i am using Linux base hosting, that is running Apache, so what should be my php.ini configuration?

dvdhinton
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Tue Oct 06, 2009 11:28 am

Re: Could not instantiate mail function error (different from ot

Postby dvdhinton » Thu Nov 26, 2009 2:49 pm


Ironside
Joomla! Ace
Joomla! Ace
Posts: 1649
Joined: Mon Nov 13, 2006 8:01 pm
Contact:

Re: Could not instantiate mail function error (different from ot

Postby Ironside » Tue Dec 08, 2009 11:02 pm

I had this problem today, for the life of me couldn't find out what was wrong and then found something really simple causing the problem.Basically when I entered the e-mail , somehow some more text was tagged. onto the end in the e-mail field
Ham and eggs. A day's work for a chicken, a lifetime commitment for a pig.

http://www.tetraplegicliving.com
http://www.oscarfishlover.com


User avatar
gsa
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Thu Nov 08, 2007 4:58 am

Re: Could not instantiate mail function error (different from ot

Postby gsa » Tue Jan 19, 2010 8:35 am

The short version: This error may be simply the result of asking Joomla to send an email to a non-existing email address.

The long version:
It appears that there are various situations that cause the "Could not instantiate mail function" error. I am sure some of them call for the extreme measures suggested in this thread and other threads on the same problem, but I also suspect that many can be resolved much more easily...

Before leaping into the dangerous waters of making spaghetti out of the Joomla code, I recommend to those experiencing this problem to start by making absolutely sure that all email addresses which will need to be used (e.g., the recipient of a contact form) are correct AND valid AND exist.

Let's say that your install is at www.some-crazy-site.com and you want your visitors to be able to email to Mr. Zebra who is a member of your team and whose email address is [email protected] . Naturally, you will set up a Joomla contact for Mr. Zebra with the email address [email protected] (you don't even need for Mr. Zebra to be a user). But this is NOT ENOUGH. The email address [email protected] MUST EXIST as a valid and working email address. If you are hosted somewhere, go to the cPanel and set it up as an email account for [email protected] .

Bottom line:
1. Make sure that the link/menu-item to the contact form (or equivalent functionality) is current and connected to a real and live contact (not an old leftover from some migrated/replicated installation).
2. Make sure that the contact's email address exists, is valid and is correct.

hylndr11
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Feb 02, 2010 3:22 pm

Re: Could not instantiate mail function error (different from ot

Postby hylndr11 » Wed Feb 03, 2010 5:12 pm

Interesting, I am experiencing the same thing over another issue though, I transferred my site to another domain and hosting account. Setup webmail on cpanel and all settings seem to be right but when i try to send out email with mass mail it gives me this error, host said everything is correct...i dont know,

Lamer4o
Joomla! Intern
Joomla! Intern
Posts: 74
Joined: Thu May 20, 2010 11:37 pm

Re: Could not instantiate mail function error (different fro

Postby Lamer4o » Tue May 25, 2010 10:51 pm

So this is and old topic,but let's bring it back to life ... i saw some dude's say they can use this Securemail Patch ... but first for 1.5.8 and second the link for download is old and don't work so here is my question :
Can some one please get mi a Link for download (but working) but for 1.5.15 Version of Joomla, becoas i get first this error :
* Could not instantiate mail function.
* Could not instantiate mail function.
* Your account has been created and an activation link has been sent to the e-mail address you entered. Note that you must activate the account by clicking on the activation link when you get the e-mail before you can login.

and then after few adjustment i get this error :


* SMTP Error! Could not connect to SMTP host.
* SMTP Error! Could not connect to SMTP host.

Message

* Your account has been created and an activation link has been sent to the e-mail address you entered. Note that you must activate the account by clicking on the activation link when you get the e-mail before you can login.

So my only change is this Secure Mail (FOR 1.5.15 Version of Joomla) Works (I have a Gmail account [ free ] ) so please help out!
Please read forum rules regarding signatures: viewtopic.php?t=65

mathewsmail13
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sun Jun 06, 2010 7:49 pm

Re: Could not instantiate mail function error (different fro

Postby mathewsmail13 » Sun Jun 06, 2010 8:04 pm

Guys, every time i tried to add the contact email to joomla, i had the problems with settings and i had to play around for a long time. but i have solved the problem twice.
These may be useful only for websites with godaddy, i dont know if this is gonna work with other hosts. the following are what i have done.
1. make sure the hosting is linux based and not windows.(thats what worked for me)
2. in your hosting account make the desired email account.
3. make sure you have the same email specified in the 'email from' in the email settings of your hosting account.
4.when you add the 'contact' module, make sure you have the same email address you made with your domain.
5. in global configuration the settings should be as follows:

Mailer : PHP mail function
Mail from : [email protected] (eg: [email protected] )
From Name : whatever name you want to appear as 'from' when you send an email
Sendmail Path :/usr/sbin/sendmail
SMTP Authentication :Yes
SMTP Security :none
SMTP Port : 25
SMTP Username : username of your email (eg:info)
SMTP Password : your email password
SMTP Host: relay-hosting.secureserver.net (this particular one was different to the previous hosting account. so i recommend trying with the default SMTP host name you get in this field first)

GOOD LUCK GUYS ;)


gavakie
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Wed Apr 14, 2010 3:51 pm

Re: Could not instantiate mail function error (different fro

Postby gavakie » Tue Jun 29, 2010 9:15 pm

I am having the same problems, wierd thing is there is another joomla site setup where the mail is working but I cant get it to work on this site.

kohler
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Fri Aug 06, 2010 4:54 am

Re: Could not instantiate mail function error (different fro

Postby kohler » Fri Aug 06, 2010 5:31 am

my port 25 is blocked from my isp is there a way around that mailer thing even with port 25 being blocked... i tried the whole smtp.gmail.com and it still isn't working...
Mailer SMTP Server
Mail from [email protected]
From Name domain name
Sendmail Path /usr/sbin/sendmail
SMTP Authentication Yes
SMTP Security none
SMTP Port 465
SMTP Username [email protected]
SMTP Password my password
SMTP Host smtp.gmail.com

once i sign a new user up, it loads and goes to a white page same as the send mass mail link in the admin cp... this is confusing me...

kohler
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Fri Aug 06, 2010 4:54 am

Re: Could not instantiate mail function error (different fro

Postby kohler » Thu Aug 12, 2010 4:42 am

is anyone else watching this thread besides me?

zingo-46
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Jul 28, 2010 8:28 am

Re: Could not instantiate mail function error (different fro

Postby zingo-46 » Fri Aug 20, 2010 11:10 pm

I also have the same problem, however, sometimes it works and sometimes not.

I user Userport to register new users and sometimes the notification mail goes out properly but sometimes it doesn't. It can be 2-3 times of failure with the above error and then suddenly it works fine. The user is added properly to the database every time, just the mail that fails every now and then.

I have tried different combinations etc to see if there is a pattern but I haven't found one so far. It may work direct, 2-3 times then it may fail a couple of times then it is ok again.

The fact that it does work at all makes misconfig in the mail-settings less likely, I recon, but what makes it fail every second or 2 out of three times? I keep feeding the same CSV-string over and over again, deleting the user after each failed attempt, until it works.

The idea of using CSV was to make it faster and easier to enter some 400 users but so far it has not been that successful...

Btw, I'm using Joomla 1.5.18, php-mail function and userport 1.7.

Anybody that has some clue?
Rgds
/c

funkDoc
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Sep 15, 2010 11:47 pm

Re: Could not instantiate mail function error (different fro

Postby funkDoc » Wed Sep 15, 2010 11:56 pm

Hey all, just seeing the status of this issue. I haven't been able to get joomla configured to work with gmail either. I can send and receive email through clients (thunderbird) on the same machine, using the exact same information I use in joomla. Here's my enviornment:
os:win7
web server: apache 2.2
joomla: 1.5.20

Thanks for any help on this, I'm extremely desperate to get this working. I have been very happy with joomla but need to fix this issue, any tips would be greatly appreciated.

Is email authentication on windows with gmail not supported?

User avatar
leolam
Joomla! Master
Joomla! Master
Posts: 16083
Joined: Mon Aug 29, 2005 10:17 am
Location: Netherlands/ UK/ S'pore/Jakarta/ North America
Contact:

Re: Could not instantiate mail function error (different fro

Postby leolam » Thu Sep 16, 2010 3:29 am

kohler wrote:my port 25 is blocked from my isp is there a way around that mailer thing even with port 25 being blocked... i tried the whole smtp.gmail.com and it still isn't working...
Mailer SMTP Server
Mail from [email protected]
From Name domain name
Sendmail Path /usr/sbin/sendmail
SMTP Authentication Yes
SMTP Security none
SMTP Port 465
SMTP Username [email protected]
SMTP Password my password
SMTP Host smtp.gmail.com
Gmail utilizes:
* SMTP-security : TLS
* Port: 587 (Outlook) and 465 in Thunderbird
http://mail.google.com/support/bin/answ ... swer=86374 and choose your email client to configure properly

Leo 8)
-- Joomla Professional Support Services : https://gws-desk.com --
-- Joomla Specialized Hosting Solutions: https://gws-host.com --
-- Joomla Professional Web Development & Design :www.gws-studio.com
-- Member Joomla Bug Squad --

SuperMole
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Sat Jan 10, 2009 9:37 pm

Re: Could not instantiate mail function error (different fro

Postby SuperMole » Mon Oct 18, 2010 7:35 pm

Acario wrote:
Could not instantiate mail function error


I got this message too. Took a bit to realize I forgot to put in the Administrator email address in the JForms form I made. Works fine now. Thought I'd share this since it's something so simple I'm sure others are looking over it too.

Helped me. Thanks for pointing this out. Maybe in JForms 0.7 they made it stand out more clearly...

v_vorn
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sat Dec 11, 2010 7:00 am

Re: Could not instantiate mail function error (different fro

Postby v_vorn » Thu Jan 06, 2011 2:40 pm

mathewsmail13 wrote:Guys, every time i tried to add the contact email to joomla, i had the problems with settings and i had to play around for a long time. but i have solved the problem twice.
These may be useful only for websites with godaddy, i dont know if this is gonna work with other hosts. the following are what i have done.
1. make sure the hosting is linux based and not windows.(thats what worked for me)
2. in your hosting account make the desired email account.
3. make sure you have the same email specified in the 'email from' in the email settings of your hosting account.
4.when you add the 'contact' module, make sure you have the same email address you made with your domain.
5. in global configuration the settings should be as follows:

Mailer : PHP mail function
Mail from : [email protected] (eg: [email protected] )
From Name : whatever name you want to appear as 'from' when you send an email
Sendmail Path :/usr/sbin/sendmail
SMTP Authentication :Yes
SMTP Security :none
SMTP Port : 25
SMTP Username : username of your email (eg:info)
SMTP Password : your email password
SMTP Host: relay-hosting.secureserver.net (this particular one was different to the previous hosting account. so i recommend trying with the default SMTP host name you get in this field first)

GOOD LUCK GUYS ;)



:) I only can say "THANKS YOU SO MUCH....." :)

It absolutely works !!!!

wolf4
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Sun Jan 16, 2011 8:26 am

Re: Could not instantiate mail function error (different fro

Postby wolf4 » Wed Feb 02, 2011 7:06 am

I did not yet get it to work.
I followed many of your suggestions.

Funny thing is, the system sends a user registration email to me ... that works!
Only the contact form - whatever method I try ... does not response.

My provider support, without giving a direct answer, is telling me:
"One thing I have learned, emails are likely to not deliver if a valid "from" address is not specified in the emailing PHP script."

Which sending script? What could she mean?

mikenick
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri Apr 08, 2011 3:18 pm

Re: Could not instantiate mail function error (different fro

Postby mikenick » Fri Apr 08, 2011 3:51 pm

I am using SysSoft Hosting for Joomla 1.5.22
I am attempting to set up the contact form. I am getting the same errors others have had.

If I change the Global Configuration - Mail Settings to PHP Mail Function, then I get a Could Not Instantiate error

If I change the Global Configuration - Mail Settings to Sendmail, then I get a PHPMAILER_EXECUTE/usr/sbin/sendmail error.

If I change the Global Configuration - Mail Settings to PHP Mail Function, then I get a SMTP Error! Could not connect to SMTP host error. I changed the SMTP Port number from 25 to 465, but then the page eventually goes to a blank page and no email was sent.

I don't know much of any PHP and I think if I did I might be able to fix my problem. If I use the PHP Mail Function option, I'm sure there are some files I could add code to to fix the problem, but I do not know the proper code. Any ideas here?

The other problem is that I am trying to test the contact form with my gmail account, but the from email address will eventually be switched over to the [email protected] address. This is a class project for a customer so its been a little tricky trying to test it.

I am frustrated so I am changing bits and pieces constantly now and I might have actually had the right things done, but not in the right combination -- or not!

And ideas?

xanterra
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Thu Apr 08, 2010 8:50 pm

Re: Could not instantiate mail function error (different fro

Postby xanterra » Mon Apr 11, 2011 8:05 pm

Hi there, i have same error since the first day i have installed Joomla on my windows 2008 server.
This error apperas when user registers on front end or when i try to send massmail via admin console.

I have also read all related articles and could not find an answer to resolve this problem and hoping you can help.

Please pay attention to attached image as I have noticed that before I get " Could not instantiate mail function." error in Jomla, i was able to capture the message before joomla returns the error.

Line:228 $error = end($this->_errors); in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\cms\libraries\joomla\error

Enviroment settings:
Windows 2008 server/ Apache 2.2.17 / PHP 5.3.5 / Joomla 1.6 /

mail settings under Global configuration:
Mailer: PHPMail
From email: [email protected]
From name: anyname
Sendmail path: /usr/sbin/sendmail
SMTP authentication: No
SMTP security: None
SMTP username: [email protected]
SMTP password:" blank"
SMTP Host: smtprelay.exchange.com (this relay server is serving other domains in our environment so do not confuse with my domain name and this host name)
You do not have the required permissions to view the files attached to this post.
Cheers,
XanterRa

xanterra
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Thu Apr 08, 2010 8:50 pm

Re: Could not instantiate mail function error (different fro

Postby xanterra » Tue Apr 19, 2011 2:42 pm

Hi there,

getting no answer to my previous question gave me some time to search bit more in different avenues and finally i was able to figure out the issue.

My investigation has revealed that there was a missing FW rule between server where joomla is hosted and smtp server which is in another network.

However I would like to bring below suggestion to moderators or Joomla developers to create more user friendly error logs as original error message I was getting was misleading.

This topic is posted in many other places and as a new Joomla user, I should be able to see the where error is coming from in Joomla so i can dig myself before asking to forum. As you will see in previous attachment, error messaging was misleading to something in time zone which has nothing to do with missing FW rule.

Why Joomla does not thrown the last php error as soon as I use PHPmailer in the log file which will tell me exact problem.

For the rest of the user, if you have similar issue, please check your PHP error log in below path if you are using windows server and did not change default settings.
C:\Windows\temp\php-errors.log

Cheers,
Cheers,
XanterRa

surendrapareek
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed Oct 12, 2011 7:08 am

Failed to send message.: PHPMAILER_CONNECT_HOST

Postby surendrapareek » Mon Oct 31, 2011 6:24 am

pls tell me the reason of this error i am using flexi contact modoule for the contact form with local host my site is not hosted now

stanzahero
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Mon Oct 27, 2008 11:19 pm

Re: Could not instantiate mail function error (different fro

Postby stanzahero » Mon Dec 19, 2011 1:06 am

I had this issue because Joomla! (Jobline component) was trying to send an email with the 'to address' and the 'from address' the same.
I did a check before sending it:
if ( $email != $cfgjl['mailfromaddress'] ) {
send email here...
}


Return to “Joomla! 1.5 Bug Reporting”

Who is online

Users browsing this forum: No registered users and 7 guests