Actions

API16

JMailHelper/cleanBody

< API16:JMailHelper

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description

Cleans any injected headers from the E-Mail body.



Syntax

static cleanBody($body)
Parameter Name Default Value Description
$body $body E-Mail body string.

Returns

string Cleaned E-Mail body string.

Defined in

libraries/joomla/mail/helper.php

Importing

jimport( 'joomla.mail.helper' );

Source Body

public static function cleanBody($body)
{
        // Strip all E-Mail headers from a string
        return preg_replace("/((From:|To:|Cc:|Bcc:|Subject:|Content-type:) ([\S]+))/", "", $body);
}



Examples

Code Examples


Advertisement