Back to PhocacartEmailMail class

Method sendMailA

public
sendMailA
(mixed $from, mixed $fromName, mixed $recipient, mixed $subject, mixed $body, mixed $mode = false, mixed $cc = null, mixed $bcc = null, mixed $attachment = null, mixed $attachmentString = '', mixed $attachmentFileName = '', mixed $replyTo = null, mixed $replyToName = null)

Method sendMailA - Source code

// PHOCAEDIT
//public function sendMail($from, $fromName, $recipient, $subject, $body, $mode = false, $cc = null, $bcc = null, $attachment = null,
//	$replyTo = null, $replyToName = null)
public function sendMailA($from, $fromName, $recipient, $subject, $body, $mode = false, $cc = null, $bcc = null, $attachment = null, $attachmentString = '', $attachmentFileName = '', $replyTo = null, $replyToName = null)
{
    $this->setSubject($subject);
    $this->setBody($body);
    // Are we sending the email as HTML?
    $this->isHtml($mode);
    /*
     * Do not send the message if adding any of the below items fails
     */
    if ($this->addRecipient($recipient) === false) {
        return false;
    }
    if ($this->addCc($cc) === false) {
        return false;
    }
    if ($this->addBcc($bcc) === false) {
        return false;
    }
    // PHOCAEDIT
    if ($attachmentString != '' && $attachmentFileName != '') {
        if ($this->addStringAttachment($attachmentString, $attachmentFileName) === false) {
            return false;
        }
    }
    //public function addAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream', $disposition = 'attachment')
    if ($this->addAttachment($attachment) === false) {
        return false;
    }
    // Take care of reply email addresses
    if (is_array($replyTo)) {
        $numReplyTo = count($replyTo);
        for ($i = 0; $i < $numReplyTo; $i++) {
            if ($this->addReplyTo($replyTo[$i], $replyToName[$i]) === false) {
                return false;
            }
        }
    } elseif (isset($replyTo)) {
        if ($this->addReplyTo($replyTo, $replyToName) === false) {
            return false;
        }
    }
    // Add sender to replyTo only if no replyTo received
    $autoReplyTo = empty($this->ReplyTo) ? true : false;
    if ($this->setSender(array($from, $fromName, $autoReplyTo)) === false) {
        return false;
    }
    return $this->Send();
}