API16:JUtility/sendMail
From Joomla! Documentation
Description
Mail function (uses phpMailer)
Syntax
static sendMail($from, $fromname, $recipient, $subject, $body, $mode=0, $cc=null, $bcc=null, $attachment=null, $replyto=null, $replytoname=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $from | $from From e-mail address | |
| $fromname | $fromname From name | |
| $recipient | $recipient Recipient e-mail address(es) | |
| $subject | $subject E-mail subject | |
| $body | $body Message body | |
| $mode | 0 | $mode false = plain text, true = HTML |
| $cc | null | $cc CC e-mail address(es) |
| $bcc | null | $bcc BCC e-mail address(es) |
| $attachment | null | $attachment Attachment file name(s) |
| $replyto | null | $replyto Reply to email address(es) |
| $replytoname | null | $replytoname Reply to name(s) |
Returns
boolean True on success
Defined in
libraries/joomla/utilities/utility.php
Importing
jimport( 'joomla.utilities.utility' );
Source Body
public static function sendMail($from, $fromname, $recipient, $subject, $body, $mode=0, $cc=null, $bcc=null, $attachment=null, $replyto=null, $replytoname=null)
{
// Get a JMail instance
$mail = &JFactory::getMailer();
return $mail->sendMail($from, $fromname, $recipient, $subject, $body, $mode, $cc,
$bcc, $attachment, $replyto, $replytoname);
}
Examples
Code Examples