$mail = JMail::getInstance();
$mail->sendMail($vendorEmail,$vendorName,$email,$subject,$body,true,null,null,$file);
ulink($file);
in some code after
$mailer = JFactory::getMailer();
$mailer->addRecipient( $recipient );
$mailer->setSubject( $subject );
$mailer->setBody( $body );
$mailer->setSender( $sender );
$return = $mailer->Send();
got email whith $body content in second email
email with empty body
PHP 5.4.19
Apache/2.4.4 (Win32) OpenSSL/0.9.8y PHP/5.4.19
apache2handler
Joomla! 3.4.1 Stable [ Ember ] 21-March-2015 20:30 GMT
Platform Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
libraries\vendor\phpmailer\phpmailer\class.phpmailer.php in method createBody try to get an attachmet that was in email before and removed and set $body='' on error
adding clearAttachments(); after sending in sendMail will fix problem
Title |
|
Title |
|
Category | Libraries | ⇒ | External Library Libraries |
Status | New | ⇒ | Information Required |
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-07-19 18:03:17 |
Closed_By | ⇒ | brianteeman |
After several months without further reply to the request for further information this issue is being closed. It can always be re-opened
It is late but a complete example based on the description above.
$body = '<html>
<body>
<div align="center">simple HTML Email in Joomla</div>
</body>
</html>';
//@set mailing options (to,subject,body etc)
$mailer->addRecipient($recipient);
$mailer->setSubject('Booking Gift Voucher for Driving Lesson');
$mailer->isHTML(true);
$mailer->Encoding = 'base64';
$mailer->CharSet = 'UTF-8';
$mailer->setBody($body);
$mailer->setSender($sender);
// Optional file attached
$mailer->addAttachment('assets/pdf/Voucher-IKTCVPA8S9.pdf');
Hope it helps someone.
I am afraid I do not exactly follow you. Could you please post a complete example with the code where all the variables (like $body) are defined.
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6898.