API15

API15:JMailHelper/cleanBody

From Joomla! Documentation

Description

Cleans any injected headers from the E-Mail body.

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

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

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

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

Code Examples