public function createSimpleEmailMessage($from, $to, $subject, $htmlBody, $textBody, $cc = [], $bcc = [], $replyTo = [])
    {
        $instance = $this->getMessageInstance();

        $this->setupMessageHeaders($instance, $from, $to, $cc, $bcc, $replyTo);

        $instance->setSubject($subject);

        // If we do not have an HTML message
        if (empty($htmlMessage)) {
            // Message body is the text message
            $instance->setBody($textBody, 'text/plain');
        } else {
            // The main body is the HTML messahe
            $instance->setBody($htmlBody, 'text/html');

            // Use the text as a message part, if we have one.
            if (! empty($textMessage)) {
                $instance->addPart($textBody, 'text/plain');
            }
        }

        return $instance;
    }
public function createSimpleEmailMessage($from, $to, $subject, $htmlBody, $textBody, $cc = [], $bcc = [], $replyTo = [])
    {
        $instance = $this->getMessageInstance();

        $this->setupMessageHeaders($instance, $from, $to, $cc, $bcc, $replyTo);

        $instance->setSubject($subject);

        // If we do not have an HTML message
        if (empty($htmlMessage)) {
            // Message body is the text message
            $instance->setBody($textBody, 'text/plain');
        } else {
            // The main body is the HTML messahe
            $instance->setBody($htmlBody, 'text/html');

            // Use the text as a message part, if we have one.
            if (! empty($textMessage)) {
                $instance->addPart($textBody, 'text/plain');
            }
        }

        return $instance;
    }
public function createSimpleEmailMessage ( $ from , $ to , $ subject , $ htmlBody , $ textBody , $ cc = [ ] , $ bcc = [ ] , $ replyTo = [ ] ) { $ instance = $ this -> getMessageInstance ( ) ; $ this -> setupMessageHeaders ( $ instance , $ from , $ to , $ cc , $ bcc , $ replyTo ) ; $ instance -> setSubject ( $ subject ) ; // If we do not have an HTML message if ( empty ( $ htmlMessage ) ) { // Message body is the text message $ instance -> setBody ( $ textBody , 'text/plain' ) ; } else { // The main body is the HTML messahe $ instance -> setBody ( $ htmlBody , 'text/html' ) ; // Use the text as a message part, if we have one. if ( ! empty ( $ textMessage ) ) { $ instance -> addPart ( $ textBody , 'text/plain' ) ; } } return $ instance ; }
Create a SwiftMessage instance from text

@param  array  $from              From addresses. An array of (email-address => name)
@param  array  $to                To addresses. An array of (email-address => name)
@param  string $subject           the message subject
@param  string $htmlBody          the HTML message body, or null
@param  string $textBody          the text message body, or null
@param  array  $cc                Cc addresses. An array of (email-address => name) [optional]
@param  array  $bcc               Bcc addresses. An array of (email-address => name) [optional]
@param  array  $replyTo           Reply to addresses. An array of (email-address => name) [optional]

@return \Swift_Message the generated and built message.
Create a SwiftMessage instance from text