MediaWiki  master
MailAddress Class Reference

Stores a single person's name and email address. More...

Public Member Functions

 __construct ( $address, $name=null, $realName=null)
 Stable to call. More...
 
 __toString ()
 
 toString ()
 Return formatted and quoted address to insert into SMTP headers. More...
 

Static Public Member Functions

static newFromUser (User $user)
 Create a new MailAddress object for the given user. More...
 

Public Attributes

string $address
 
string $name
 
string $realName
 

Detailed Description

Stores a single person's name and email address.

These are passed in via the constructor, and will be returned in SMTP header format when requested.

@newable

Definition at line 34 of file MailAddress.php.

Constructor & Destructor Documentation

◆ __construct()

MailAddress::__construct (   $address,
  $name = null,
  $realName = null 
)

Stable to call.

Parameters
string$addressString with an email address
string | null$nameHuman-readable name if a string address is given
string | null$realNameHuman-readable real name if a string address is given

Definition at line 57 of file MailAddress.php.

References $address, $name, and $realName.

Member Function Documentation

◆ __toString()

MailAddress::__toString ( )

Definition at line 101 of file MailAddress.php.

References toString().

◆ newFromUser()

static MailAddress::newFromUser ( User  $user)
static

Create a new MailAddress object for the given user.

Since
1.24
Parameters
User$user
Returns
MailAddress

Definition at line 70 of file MailAddress.php.

References User\getEmail(), User\getName(), and User\getRealName().

Referenced by EmailNotification\compose(), EmailNotification\composeCommonMailtext(), User\sendMail(), EmailNotification\sendPersonalised(), and SpecialEmailUser\submit().

◆ toString()

MailAddress::toString ( )

Return formatted and quoted address to insert into SMTP headers.

Returns
string

Definition at line 78 of file MailAddress.php.

References $address, $name, $wgEnotifUseRealName, UserMailer\quotedPrintable(), and wfIsWindows().

Referenced by __toString(), and UserMailer\sendInternal().

Member Data Documentation

◆ $address

string MailAddress::$address

Definition at line 48 of file MailAddress.php.

Referenced by __construct(), and toString().

◆ $name

string MailAddress::$name

Definition at line 38 of file MailAddress.php.

Referenced by __construct(), and toString().

◆ $realName

string MailAddress::$realName

Definition at line 43 of file MailAddress.php.

Referenced by __construct().


The documentation for this class was generated from the following file: