Property | Type | Description | |
---|---|---|---|
$_address | 发件人邮件地址 | ||
$_attachment | 附件 | ||
$_bcc | 秘密抄送 | ||
$_body | 邮件正文 | ||
$_cc | 抄送 | ||
$_errorMessage | 错误信息 | ||
$_from | 发件人 | ||
$_isSecurity | 是否是安全连接 | ||
$_password | 邮件传输代理密码 | ||
$_port | 邮件传输代理服务器端口 | ||
$_sendServer | 邮件传输代理服务器地址 | ||
$_socket | socket资源 | ||
$_subject | 主题 | ||
$_to | 收件人 | ||
$_userName | 邮件传输代理用户名 |
Method | Description | |
---|---|---|
__construct ( ) | ||
addAttachment ( string $file ) : boolean | 设置邮件附件,多个附件,调用多次 | |
error ( ) : string | 返回错误信息 | |
isAvailable ( ) | ||
send ( |
||
sendMail ( ) : boolean | 发送邮件 | |
setAddress ( $address ) | ||
setBcc ( string $bcc ) : boolean | 设置秘密抄送,多个秘密抄送,调用多次 | |
setCc ( string $cc ) : boolean | 设置抄送,多个抄送,调用多次. | |
setFrom ( string $from ) : boolean | 设置发件人 | |
setMail ( string $subject, string $body ) : boolean | 设置邮件信息 | |
setReceiver ( string $to ) : boolean | 设置收件人,多个收件人,调用多次. | |
setServer ( string $server, string $username = "", string $password = "", integer $port = 25, boolean $isSecurity = false ) : boolean | 设置邮件传输代理,如果是可以匿名发送有邮件的服务器,只需传递代理服务器地址就行 |
Method | Description | |
---|---|---|
close ( ) : boolean | 关闭socket | |
closeSecutity ( ) : boolean | 关闭安全socket | |
getCommand ( ) : array | 返回mail命令 | |
getMIMEType ( string $file ) : mixed | 获取附件MIME类型 | |
readFile ( string $file ) : mixed | 读取附件文件内容,返回base64编码后的文件内容 | |
sendCommand ( string $command, integer $code ) : boolean | 发送命令 | |
sendCommandSecurity ( string $command, integer $code ) : boolean | 安全连接发送命令 | |
socket ( ) : boolean | 建立到服务器的网络连接 | |
socketSecurity ( ) : boolean | 建立到服务器的SSL网络连接 |
public addAttachment ( string $file ) : boolean | ||
$file | string | 文件地址 |
return | boolean |
protected getMIMEType ( string $file ) : mixed | ||
$file | string | 文件 |
return | mixed |
public setReceiver ( string $to ) : boolean | ||
$to | string | 收件人地址 |
return | boolean |
public setServer ( string $server, string $username = "", string $password = "", integer $port = 25, boolean $isSecurity = false ) : boolean | ||
$server | string | 代理服务器的ip或者域名 |
$username | string | 认证账号 |
$password | string | 认证密码 |
$port | integer | 代理服务器的端口,smtp默认25号端口 |
$isSecurity | boolean | 到服务器的连接是否为安全连接,默认false |
return | boolean |
protected socketSecurity ( ) : boolean | ||
return | boolean |