Changes to the JMail class
Joomla 3.5.1 +
Joomla recently made some needed changes to the JMail class (Joomla 3.5.1). In the past all errors were silently ignored but with these changes errors such as 0 - Invalid may start to appear depending on your current settings.
One of the main causes for this type of error is missing or incorrectly entered From Email and or From Name in the Joomla mail settings. You can easliy check these settings by going to:
Global Configuration > Server > Mail Settings
Once you are there make sure that you have specified both a From email and From Name and that the From Email is a valid email address.
If for example you have the CoalaWeb Contact component's option Mail From set to Contact Form User and the Display Email set to Hide or Not Required when a form is submitted without an email being entered it will throw an error.
The easiest way to fix this is to make sure you have correctly set the Joomla mail settings for From email and From Name and then in the CoalaWeb Contact component options set Mail From to Joomla Mail Settings. This will make sure that these values are always available irrespective of the contact form.
In general I recommend having the CoalaWeb Contact option Mail From set to Joomla Mail Settings not just because of these changes to Joomla's JMail class but also because some servers will not process the form otherwise.