Answer for Users:
If you are getting this error because you are using some extension that sends emails, please visit the developer page, and first make sure you are using the latest version.
If you are 100% sure that you are using the latest version, but still getting this error, you should contact the developer and ask them about this error. Sending them ...
You need a valid smtp server account in order to be able to send emails through SMTP.
Your configuration settings show:
SMTP Host = localhost
SMTP User = ''; // none, empty
SMTP Password = ''; //none, empty
Since I see localhost for the host, I assume you want to use the smtp server of our hosting account. In this case you need to ask your ...
I stumbled upon the same problem and here is what I tried and worked for me.
$mailer = JFactory::getMailer();
$mailer->CharSet = 'UTF-8';
$mailer->Encoding = 'base64';
$mailer->AltBody = $...
The properties that you're using do not exist (I don't know where you're getting them from). You will need to use the function useSmtp in the JMail class in order to set the host, the port, etc... See: libraries\joomla\mail\mail.php.
I also noticed your password and username were empty in the configurations you posted: essentially, you do not actually have SMTP and as Michael's warning states, your previous host was actually just allowing you to send without any authorization and creating a security vulnerability.
A host will have documentation on their SMTP requirements and settings. ...
In order for you to use the SMTP option in Joomla! on your local installation, you will need an SMTP service installed on that PC listening to port 25 (or whatever port you assign).
If you do not have an SMTP service running on your PC (which you likely do not), you can change:
public $mailer = 'smtp';
public $mailer = 'mail';
This will ...
So here is the code that works :
//preparation et envoi du mail
//provenance du mail
$sender = array('myEmailAddress','myName');
//destibnataires du mail
$m->addRecipient($to); //an array of emails
//sujet du message
//encodage du mail