components/PhpMailer.php
function create_body() {
      // wordwrap the message body if set
      if($this->WordWrap)
         $this->Body = $this->wordwrap($this->Body, $this->WordWrap);

      // If content type is multipart/alternative set body like this:
      if ((!empty($this->AltBody)) && (count($this->attachment) < 1))
      {
         // Return text of body
         $mime = array();
         $mime[] = "This is a MIME message. If you are reading this text, you\r\n";
         $mime[] = "might want to consider changing to a mail reader that\r\n";
         $mime[] = "understands how to properly display MIME multipart messages.\r\n\r\n";
         $mime[] = sprintf("--Boundary-=%s\r\n", $this->boundary);

         // Insert body. If multipart/alternative, insert both html and plain
         $mime[] = sprintf("Content-Type: %s; charset = \"%s\"; boundary = \"Boundary-=%s\";\r\n",
                           $this->ContentType, $this->CharSet, $this->subboundary);
         $mime[] = sprintf("Content-Transfer-Encoding: %s\r\n\r\n", $this->Encoding);

         $mime[] = sprintf("--Boundary-=%s\r\n", $this->subboundary);
         $mime[] = sprintf("Content-Type: text/html; charset = \"%s\";\r\n", $this->CharSet);
         $mime[] = sprintf("Content-Transfer-Encoding: %s\r\n\r\n", $this->Encoding);
         $mime[] = sprintf("%s\r\n\r\n", $this->Body);

         $mime[] = sprintf("--Boundary-=%s\r\n", $this->subboundary);
         $mime[] = sprintf("Content-Type: text/plain; charset = \"%s\";\r\n", $this->CharSet);
         $mime[] = sprintf("Content-Transfer-Encoding: %s\r\n\r\n", $this->Encoding);
         $mime[] = sprintf("%s\r\n\r\n", $this->AltBody);

         $mime[] = sprintf("\r\n--Boundary-=%s--\r\n\r\n", $this->subboundary);

         $mime[] = sprintf("\r\n--Boundary-=%s--\r\n", $this->boundary);

         $this->Body = $this->encode_string(join("", $mime), $this->Encoding);
      }
      else
      {
         $this->Body = $this->encode_string($this->Body, $this->Encoding);
      }


      if(count($this->attachment) > 0)
      {
         if(!$body = $this->attach_all())
            return false;
      }
      else
         $body = $this->Body;

      return($body);
   }
function create_body() {
      // wordwrap the message body if set
      if($this->WordWrap)
         $this->Body = $this->wordwrap($this->Body, $this->WordWrap);

      // If content type is multipart/alternative set body like this:
      if ((!empty($this->AltBody)) && (count($this->attachment) < 1))
      {
         // Return text of body
         $mime = array();
         $mime[] = "This is a MIME message. If you are reading this text, you\r\n";
         $mime[] = "might want to consider changing to a mail reader that\r\n";
         $mime[] = "understands how to properly display MIME multipart messages.\r\n\r\n";
         $mime[] = sprintf("--Boundary-=%s\r\n", $this->boundary);

         // Insert body. If multipart/alternative, insert both html and plain
         $mime[] = sprintf("Content-Type: %s; charset = \"%s\"; boundary = \"Boundary-=%s\";\r\n",
                           $this->ContentType, $this->CharSet, $this->subboundary);
         $mime[] = sprintf("Content-Transfer-Encoding: %s\r\n\r\n", $this->Encoding);

         $mime[] = sprintf("--Boundary-=%s\r\n", $this->subboundary);
         $mime[] = sprintf("Content-Type: text/html; charset = \"%s\";\r\n", $this->CharSet);
         $mime[] = sprintf("Content-Transfer-Encoding: %s\r\n\r\n", $this->Encoding);
         $mime[] = sprintf("%s\r\n\r\n", $this->Body);

         $mime[] = sprintf("--Boundary-=%s\r\n", $this->subboundary);
         $mime[] = sprintf("Content-Type: text/plain; charset = \"%s\";\r\n", $this->CharSet);
         $mime[] = sprintf("Content-Transfer-Encoding: %s\r\n\r\n", $this->Encoding);
         $mime[] = sprintf("%s\r\n\r\n", $this->AltBody);

         $mime[] = sprintf("\r\n--Boundary-=%s--\r\n\r\n", $this->subboundary);

         $mime[] = sprintf("\r\n--Boundary-=%s--\r\n", $this->boundary);

         $this->Body = $this->encode_string(join("", $mime), $this->Encoding);
      }
      else
      {
         $this->Body = $this->encode_string($this->Body, $this->Encoding);
      }


      if(count($this->attachment) > 0)
      {
         if(!$body = $this->attach_all())
            return false;
      }
      else
         $body = $this->Body;

      return($body);
   }
function create_body ( ) { // wordwrap the message body if set if ( $ this -> WordWrap ) $ this -> Body = $ this -> wordwrap ( $ this -> Body , $ this -> WordWrap ) ; // If content type is multipart/alternative set body like this: if ( ( ! empty ( $ this -> AltBody ) ) && ( count ( $ this -> attachment ) < 1 ) ) { // Return text of body $ mime = array ( ) ; $ mime [ ] = "This is a MIME message. If you are reading this text, you\r\n" ; $ mime [ ] = "might want to consider changing to a mail reader that\r\n" ; $ mime [ ] = "understands how to properly display MIME multipart messages.\r\n\r\n" ; $ mime [ ] = sprintf ( "--Boundary-=%s\r\n" , $ this -> boundary ) ; // Insert body. If multipart/alternative, insert both html and plain $ mime [ ] = sprintf ( "Content-Type: %s; charset = \"%s\"; boundary = \"Boundary-=%s\";\r\n" , $ this -> ContentType , $ this -> CharSet , $ this -> subboundary ) ; $ mime [ ] = sprintf ( "Content-Transfer-Encoding: %s\r\n\r\n" , $ this -> Encoding ) ; $ mime [ ] = sprintf ( "--Boundary-=%s\r\n" , $ this -> subboundary ) ; $ mime [ ] = sprintf ( "Content-Type: text/html; charset = \"%s\";\r\n" , $ this -> CharSet ) ; $ mime [ ] = sprintf ( "Content-Transfer-Encoding: %s\r\n\r\n" , $ this -> Encoding ) ; $ mime [ ] = sprintf ( "%s\r\n\r\n" , $ this -> Body ) ; $ mime [ ] = sprintf ( "--Boundary-=%s\r\n" , $ this -> subboundary ) ; $ mime [ ] = sprintf ( "Content-Type: text/plain; charset = \"%s\";\r\n" , $ this -> CharSet ) ; $ mime [ ] = sprintf ( "Content-Transfer-Encoding: %s\r\n\r\n" , $ this -> Encoding ) ; $ mime [ ] = sprintf ( "%s\r\n\r\n" , $ this -> AltBody ) ; $ mime [ ] = sprintf ( "\r\n--Boundary-=%s--\r\n\r\n" , $ this -> subboundary ) ; $ mime [ ] = sprintf ( "\r\n--Boundary-=%s--\r\n" , $ this -> boundary ) ; $ this -> Body = $ this -> encode_string ( join ( "" , $ mime ) , $ this -> Encoding ) ; } else { $ this -> Body = $ this -> encode_string ( $ this -> Body , $ this -> Encoding ) ; } if ( count ( $ this -> attachment ) > 0 ) { if ( ! $ body = $ this -> attach_all ( ) ) return false ; } else $ body = $ this -> Body ; return ( $ body ) ; }
Assembles the message body.  Returns a string if successful
or false if unsuccessful.
@private
@returns string
Assembles the message body . Returns a string if successful or false if unsuccessful .