WebSite X5Help Center

 
Craig K.
Craig K.
User

Could not instantiate mail function  en

Author: Craig K.
Visited 1779, Followers 1, Shared 0  

Attempting to get the contact form working. I get the "Could not instantiate mail function." error on the Control Panel under 'website test'. All the other tests on the Control Panel pass, so I don't know what it could be. Settings as follows:

PHP mailer

Send as post

I also tried the 'standard script'.

Posted on the
12 ANSWERS - 4 USEFUL - 1 CORRECT
Aleksej H.
Aleksej H.
Moderator

Hello.
1) Use only mail with your own domain. Not Google or similar.
2) Try different send settings. Including SMTP.
3) Check the email connection parameters with your hosting provider.
4) Check the mail sending from the web interface of your hosting.

Read more
Posted on the from Aleksej H.
Craig K.
Craig K.
User
Author

It is one of own domains on server with an existing email. Checked with hosting support. They looked at the WX5 PHP script and they say"The mail() function will work only with a correct 'FROM' header" so I guess it is missing.

Read more
Posted on the from Craig K.
Craig K.
Craig K.
User
Author

I think there is something wrong with the PHP script from WX5. The email only sends if a special function is set on the server specifying a special email address to handle faulty scripts. From the hosting provider instructions:

"Every e-mail that is sent through our servers requires sender verification (valid From header). This option sets your e-mail address as a From header if your mail sending scripts or softwares are improperly configured or they are completely missing a valid From header."

Read more
Posted on the from Craig K.
Paul M.
Paul M.
Moderator

Hello Craig,

Have you specified the 'From' address in Step 1 Settings > Advanced > Data Management > Email > 'Always use the following sender address' ?

Kind regards,

Paul

Search the WebSite X5 Help Center

Read more
Posted on the from Paul M.
Craig K.
Craig K.
User
Author
Paul M.
Hello Craig, Have you specified the 'From' address in Step 1 Settings > Advanced > Data Management > Email > 'Always use the following sender address' ? Kind regards, Paul Search the WebSite X5 Help Center

Yes, but it does not work on it's own... without going to the extraordinary step of forcing all emails sent from server (using contact forms) to use one sending address ( no matter the website / domain the form is on). There is more than one domain on the account. You are only supposed to take this step if there is something wrong with the PHP and no 'from' is specified.

Read more
Posted on the from Craig K.
Paul M.
Paul M.
Moderator

The field in Step 1 Data Management should not normally be filled in.  It's only there for use with certain hostings that block emails with 'From' addresses which don't match the sending domain.  So you should be able to delete your entry from that field, as you've already stated that your email is originating from your own domain.  This will allow you to use various 'From' addresses in various Contact Form Objects, as WebSite X5 will populate the 'From' address from the properties of the Contact Form Object instead.

When the 'From' address is supplied via the Contact Form Object properties then the relevant field is the one highlighted below:

Can you confirm that this field has a valid entry which is pulled from an email address field on your Contact Form, and that the email address in question has an extension which matches your own domain (i.e. email_at_your_own_domain.com)?

Going back to the 'Website Test' section of the online control panel...  did you try all five script types like Aleksej suggested?  The reason there are so many is because of the subtle differences in the various servers and hosting configurations out there.  Once WebSite X5 sends an email, it has no control over what happens to that email and how it is processed on the server.  Sometimes trying another script can yield useful clues as to what does and doesn't work with your own hosting.  You don't necessarily have to stick with that script in future.

The PHP Mailer library which WebSite X5 employs is in use by countless software applications the world over, and it's unlikely that there is something in the Mailer library itself which is truly buggy.  However, I'll flag the thread for Incomedia's attention anyway, to ensure that you receive an official response from support as soon as possible, Craig.

Read more
Posted on the from Paul M.
Craig K.
Craig K.
User
Author
Paul M.
The field in Step 1 Data Management should not normally be filled in.  It's only there for use with certain hostings that block emails with 'From' addresses which don't match the sending domain.  So you should be able to delete your entry from that field, as you've already stated that your email is originating from your own domain.  This will allow you to use various 'From' addresses in various Contact Form Objects, as WebSite X5 will populate the 'From' address from the properties of the Contact Form Object instead. When the 'From' address is supplied via the Contact Form Object properties then the relevant field is the one highlighted below: Can you confirm that this field has a valid entry which is pulled from an email address field on your Contact Form, and that the email address in question has an extension which matches your own domain (i.e. email_at_your_own_domain.com)? Going back to the 'Website Test' section of the online control panel...  did you try all five script types like Aleksej suggested?  The reason there are so many is because of the subtle differences in the various servers and hosting configurations out there.  Once WebSite X5 sends an email, it has no control over what happens to that email and how it is processed on the server.  Sometimes trying another script can yield useful clues as to what does and doesn't work with your own hosting.  You don't necessarily have to stick with that script in future. The PHP Mailer library which WebSite X5 employs is in use by countless software applications the world over, and it's unlikely that there is something in the Mailer library itself which is truly buggy.  However, I'll flag the thread for Incomedia's attention anyway, to ensure that you receive an official response from support as soon as possible, Craig.

Hi Paul,

Thanks for the detailed explanation. I have tried the various alternative scripts and none of them work. To answer your question:

"Can you confirm that this field has a valid entry which is pulled from an email address field on your Contact Form, and that the email address in question has an extension which matches your own domain (i.e. email_at_your_own_domain.com)?"   

My answer is that the 'sender email address' is pulled from a field on the form that the visitor must fill in, so this is not likely to match my domain. Up until now, I've used a free email account that is not associated with my hosting account for testing.

After considering everything you have said, and what hosting support has told me, I think the issue is with the hosting company security policy. Their server flags the 'sender email address' as coming from an outside domain and blocks it. The only recourse seems to be to use the universal fallback email I've setup within the hosting account.

Read more
Posted on the from Craig K.
Craig K.
Craig K.
User
Author

Apologies, last minute thought. Which hosting firms work well with WebsiteX5 contact forms (don't block sender email addresses from outside domains)? I'm not keen on moving hosts, but if it gets to that it would be useful to know.

Read more
Posted on the from Craig K.
Esahc ..
Esahc ..
Moderator

Craig, due to the plague of spam I would be surprised if any host allowed sending emails purporting to come from a different domain, certainly none I am aware of.

Read more
Posted on the from Esahc ..
Craig K.
Craig K.
User
Author
Paul M.
Can you confirm that this field has a valid entry which is pulled from an email address field on your Contact Form, and that the email address in question has an extension which matches your own domain (i.e. email_at_your_own_domain.com)? ...

Something interesting I've just discover is that the admin email address setup in the ecommerce shopping cart works just fine, emails are received and I can see it has been sent by the admin email address (an existing domain on hosting). Located at: Shopping cart ->sending order -> admin email address:

So it's a bit of a mystery as to why this works for the shopping cart, but not the contact form object (without going to the above mentioned measures).

Read more
Posted on the from Craig K.
Incomedia
Stefano G.
Incomedia

Hello Craig

As suggested by Paul, can you try unchecking these options and try again?

Keep me posted here

Thank you

Stefano

Read more
Posted on the from Stefano G.
Craig K.
Craig K.
User
Author
Stefano G.
Hello Craig As suggested by Paul, can you try unchecking these options and try again? Keep me posted here Thank you Stefano

Hi Stefano,

Yes thanks that works. 

Read more
Posted on the from Craig K.