php--the function of the following class is very powerful, not only can send the HTML format of the message, you can send the attachment
<?php
Class Email {
---set global variables
var $mailTo = ""; Recipient
var $mailCC = ""; Cc
var $mailBCC = ""; Secret CC
var $mailFrom = ""; Sender
var $mailSubject = ""; Theme
var $mailText = ""; Letter Body in text format
var $mailHTML = ""; Letter body in HTML format
var $mailAttachments = ""; Attachment
/* Function Setto ($inAddress): Address parameters for processing messages $inAddress
For inclusion of one or more strings, email address variables, using commas to split multiple email addresses
The default return value is True
**********************************************************/
function Setto ($inAddress) {
--Use the explode () function to split the email address according to ","
$addressArray = Explode (",", $inAddress);
--Check the legality of the email address by looping
For ($i =0 $i <count ($addressArray), $i) {if ($this->checkemail ($addressArray [$i]) ==false) return false;
--all legitimate email addresses are stored in an array
$this->mailto = implode ($addressArray, ",");
return true; }
/**************************************************
function SETCC ($inAddress) set CC email address
Parameter $inAddress is a string containing one or more e-mail addresses, an email address variable,
Use commas to split multiple mail addresses the default return value is True
**************************************************************/
function SETCC ($inAddress) {
--Use the explode () function to split the email address according to ","
$addressArray = Explode (",", $inAddress);
--Check the legality of the email address by looping
For ($i =0 $i <count ($addressArray), $i) {if ($this->checkemail ($addressArray [$i]) ==false) return false;
--all legitimate email addresses are stored in an array
$this->MAILCC = implode ($addressArray, ",");
return true; }
/***************************************************
function SETBCC ($inAddress) Set the secret cc address parameter $inAddress for inclusion of one or more
mail address of the string, email address variables, using commas to split multiple mail addresses the default return value is
True
******************************************/
function Setbcc ($inAddress) {
--Use the explode () function to split the email address according to ","
$addressArray = Explode (",", $inAddress);
--Check the legality of the email address by looping
for ($i =0; $i <count ($addressArray); $i)
{if ($this->checkemail ($addressArray [$i]) ==false)
return false;
}
--all legitimate email addresses are stored in an array
$this->MAILBCC = implode ($addressArray, ",");
return true;
}
/*****************************************************************
function Setfrom ($inAddress): Set Sender address parameters $inAddress for inclusion messages
The string default return value of the address is true
***************************************/
function Setfrom ($inAddress) {
if ($this->checkemail ($inAddress)) {
$this->mailfrom = $inAddress;
return true;
return false; }
/**********************
function Setsubject ($inSubject) for setting message subject parameters $insubject to strings