1

For debugging, I tried these lines:

jimport('joomla.mail.mail');

$m = new JMail();
$m->SetFrom('myAddressMail@xx.fr','myName');
$m->AddReplyTo('myAddressMail@xx.fr','myFirstName');
$m->sendMail('myAddressMail@xx.fr','test', 'myAddressMail@xx.fr','test', 'essai', true,'myAddressMail@xx.fr');

It works within Joomla 3.4.5 but not within Joomla 3.6.2 (same configuration = php mail - send Test Mail works).

I think that changes were made in librairies/joomla/mail/mail.php but which ones / how to use sendMail() ?

Thanks for help

1

So here is the code that works :

//preparation et envoi du mail
$m=JFactory::getMailer();

//provenance du mail
$sender = array('myEmailAddress','myName');
$m->setSender($sender);

//destibnataires du mail
$m->addRecipient($to); //an array of emails

//sujet du message
$m->setSubject($subject); 

//encodage du mail
$m->isHTML(true);
$m->Encoding='base64';

//le corps du message
$m->setBody($message); 
//$message = a string with html tag

//envoi du mail
$send = $m->Send();

Thanks Lodder and AndyGaskell for yours contributions

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.