Actions

API16

JMailHelper/cleanBody

From Joomla! Documentation

< API16:JMailHelper
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Cleans any injected headers from the E-Mail body.

[Edit Descripton]

Description:JMailHelper/cleanBody

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);
}

[Edit See Also] SeeAlso:JMailHelper/cleanBody

Examples

<CodeExamplesForm />