public function init( $config = NULL )
    {
        $this->mailer = new PHPMailer();

        foreach ( $config as $key => $value )
        {
            switch ( $key )
            {
                case 'from_email':
                    $this->mailer->From = $value;
                    break;

                case 'from_name':
                    $this->mailer->FromName = $value;
                    break;

                case 'is_html':
                    $this->mailer->isHTML( ( bool ) $value );
                    break;

                case 'smtp':
                    if ( !empty( $value ) )
                    {
                        // mark it as SMTP mail
                        $this->mailer->isSMTP();

                        $this->mailer->Host       = $value[ 'host' ];
                        $this->mailer->SMTPAuth   = $value[ 'auth' ];
                        $this->mailer->Username   = $value[ 'username' ];
                        $this->mailer->Password   = $value[ 'password' ];
                        $this->mailer->SMTPSecure = $value[ 'security' ];
                        $this->mailer->Port       = $value[ 'port' ];
                    }
                    break;

                case 'reply_to':
                    if ( !empty( $value ) )
                    {
                        $this->mailer->addReplyTo( $value[ 'email' ], $value[ 'name' ] );
                    }
                    break;

                default:
                    // do nothing
                    break;
            }
        }
    }
public function init( $config = NULL )
    {
        $this->mailer = new PHPMailer();

        foreach ( $config as $key => $value )
        {
            switch ( $key )
            {
                case 'from_email':
                    $this->mailer->From = $value;
                    break;

                case 'from_name':
                    $this->mailer->FromName = $value;
                    break;

                case 'is_html':
                    $this->mailer->isHTML( ( bool ) $value );
                    break;

                case 'smtp':
                    if ( !empty( $value ) )
                    {
                        // mark it as SMTP mail
                        $this->mailer->isSMTP();

                        $this->mailer->Host       = $value[ 'host' ];
                        $this->mailer->SMTPAuth   = $value[ 'auth' ];
                        $this->mailer->Username   = $value[ 'username' ];
                        $this->mailer->Password   = $value[ 'password' ];
                        $this->mailer->SMTPSecure = $value[ 'security' ];
                        $this->mailer->Port       = $value[ 'port' ];
                    }
                    break;

                case 'reply_to':
                    if ( !empty( $value ) )
                    {
                        $this->mailer->addReplyTo( $value[ 'email' ], $value[ 'name' ] );
                    }
                    break;

                default:
                    // do nothing
                    break;
            }
        }
    }
public function init ( $ config = NULL ) { $ this -> mailer = new PHPMailer ( ) ; foreach ( $ config as $ key => $ value ) { switch ( $ key ) { case 'from_email' : $ this -> mailer -> From = $ value ; break ; case 'from_name' : $ this -> mailer -> FromName = $ value ; break ; case 'is_html' : $ this -> mailer -> isHTML ( ( bool ) $ value ) ; break ; case 'smtp' : if ( ! empty ( $ value ) ) { // mark it as SMTP mail $ this -> mailer -> isSMTP ( ) ; $ this -> mailer -> Host = $ value [ 'host' ] ; $ this -> mailer -> SMTPAuth = $ value [ 'auth' ] ; $ this -> mailer -> Username = $ value [ 'username' ] ; $ this -> mailer -> Password = $ value [ 'password' ] ; $ this -> mailer -> SMTPSecure = $ value [ 'security' ] ; $ this -> mailer -> Port = $ value [ 'port' ] ; } break ; case 'reply_to' : if ( ! empty ( $ value ) ) { $ this -> mailer -> addReplyTo ( $ value [ 'email' ] , $ value [ 'name' ] ) ; } break ; default : // do nothing break ; } } }
Initialises the mailer.

@param array $config configuration array

@action ON_INIT_ACTION
Initialises the mailer .