形式がhtmlの場合、私のコードは機能します。
<pre>
public function partOrder()
{
$input=JFactory::getApplication()->input;
$mailer =JFactory::getMailer();
$config =JFactory::getConfig();
$mailer->setSender(array("email@email.com","name"));
$mailer->addRecipient("somerecipient@somerecipent.com");
$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>
json 形式のコントローラーで同じ関数を使用すると、「Mail Sent」メッセージが表示されます。しかし、メールは受信者に届きません。