Mails : content

Setting up mail content

The content() method is used to load the content of a mail which of course is the body of the mail. Although the setup is used for setting headers, the content() method is specifically created to handle the content (or body) part of the header. The content can either be supplied as a file path or as a text string. By default, the content() method is set for string texts. In order to change this default behavior, a second parameter must be supplied that reflects this.
Some few examples below provides a better insight to how this is done.

Sample: Loading mail content

  <?php

    $mailer = new Mailer;

    ... //other codes here

    $mailer->content('mail.body', 'file'); // load as a file    
    
    $mailer->content('Here is a mail text'); // load as a string    

  

The content() method sets a default mail body. It preferably applied after setting up the mail's default configuration setup although it can be used to as a modifier to a previously declared default body.