My code works when the format is html.
<pre>
public function partOrder()
{
$input=JFactory::getApplication()->input;
$mailer =JFactory::getMailer();
$config =JFactory::getConfig();
$mailer->setSender(array("[email protected]","name"));
$mailer->addRecipient("[email protected]");
$body="Some html message";
$mailer->isHTML(true);
$mailer->Encoding = 'base64';
$mailer->setBody($body);
$send =$mailer->Send();
$respond="";
if ( $send !== true ) {
$respond= 'Error sending email: ' . $send->message;
} else {
$respond= 'Mail sent';
}
echo $respond;
}
</pre>
When I use same function on controller for json format I get the "Mail Sent" message. But Mail doesn't reach to recipient;
I don't think there's anything wrong with your function.
However, I noticed that Gmail is quite picky when it comes which emails come trough to inbox: