|Last Updated||Ratings||Unique User Downloads||Download Rankings|
|2022-10-21 (11 months ago)||70%||Total: 632 This week: 1||All time: 5,011 This week: 172|
|php-mail-sending 1.0.2||GNU General Publi...||5.5||HTML, Email, PHP 5|
This class can send HTML email messages with attachments.
This is the main include file for all the example. You will have to redefine two variables here before trying to run the examples :
Contains files that are used as attachments by the attachments.Php example script.
Contains two images that are embedded in the html contents of several example scripts.
Html file that contains mail contents used by the external-html.php example script.
Sends an email with only a text part (no html contents).
Sends an email with both text and html parts.
Sends an email containing embedded images. Html contents are given by a string.
Sends an email whose html contents come from an external file, mail.html. The html contents reference two embedded images.
Sends an email with embedded images and attachments (coming from the data/ directory).
The Mail class is yet-another PHP mailer, with the following features :
The Mail* class requires the Adavanced Regex package, located here :
File Regex.class.php has been provided here for your convenience, but this may not be the latest version.
You can have a look at the examples/ directory, to have an overview of the various usages of this class. The file examples/README.md explains how the examples are organized, and which example does what.
The basic usage of the Mail class is fairly simple ; the following example will send a plain text mail with subject "Mail subject", and contents "Mail contents", to the address "firstname.lastname@example.org" :
$mail = new Mail ( false, "email@example.com", "Mail subject", "Mail contents" ) ; $mail -> Send ( ) ;
An exception will be thrown if something goes wrong.
The Mail class constructor has the following signature :
$mail = new Mail ( $from = false, $to = false, $subject = false, $text = false, $html = false, $html_base = false ) ;
It creates an instance of the class, and any parameters defined in the constructor can be specified later by using properties.
Parameters are the following
Adds the specified addresses to the recipient list.
The function's parameters can be any number of strings or arrays of strings containing the addresses.
Duplicate addresses will be ignored.
$mail -> AddRecipient ( 'firstname.lastname@example.org', [ 'email@example.com', 'firstname.lastname@example.org' ] ) ;
You can also manually append addresses to the To property but in this case, there will be no checking on duplicates :
$mail -> To  = 'email@example.com' ; $mail -> To  = 'firstname.lastname@example.org' ; // etc.
Adds addresses to Carbon Copy recipients.
Behaves as the AddRecipient() method. You can also manually append addresses to the CC property.
Adds addresses to Blind Carbon Copy recipients (ie, the recipients added by the AddRecipient() and AddCC() methods won't know that there are additional recipients specified as BCC).
Behaves as the AddRecipient() method. You can also manually append addresses to the BCC property.
Adds a MIME header or replaces an existing one.
Adds an attachment to the current mail. The $name parameter indicates the attachment file name that will be shown to the recipient when he will open its mail. If not specified, the filename portion of the $path parameter will be used.
Returns the mail contents as plain text, including MIME headers, text and base64-encoded attachments.
Html contents can be specified in two ways : either by specifying some value for the $html parameter of the class constructor, or setting later the Html property.
The LoadHtml() method provides a third way to load html contents, from an external file. This file can be a regular html page using <html>, <head> and <body> tags (or not) ; the following contents will be extracted from it to form the mail's html part :
The $base\_path parameter indicates the root path for searching external images referenced by html contents.
Sends the mail using the standard PHP mail() function.
An exception will be thrown if something goes wrong.
Validates an email by verifying the following elements :
It also provides default values for certain fields :
An array containing the Blind Carbon Copy recipients.
The preferred way of adding new BCC recipients is by using the AddBCC() method, which performs additional checkings, such as ignoring duplicate addresses.
An array containing the Carbon Copy recipients.
The preferred way of adding new CC recipients is by using the AddCC() method, which performs additional checkings, such as ignoring duplicate addresses.
MIME character set used for building mail contents. The default is ISO8859-1.
Email address where error messages coming from mail servers will be sent.
Sender's email address.
Html part of the mail contents.
Base path to be used for retrieving images referenced by the html contents.
Email address to be used when the recipient will reply to the mail.
Email address for the return path.
Email address to be used for read receipts.
Character set used in the source html contents.
Plain text part of the message contents.
An array containing the list of recipients.
The preferred way of adding new recipients is by using the AddRecipient() method, which performs additional checkings, such as ignoring duplicate addresses.
|data (2 files)|
|images (2 files)|
|Version Control||Unique User Downloads||Download Rankings|
|User Ratings||User Comments (1)|