PHP 클래스 Helper\Mailer\Smtp

상속: implements Contactable\IMailer
파일 보기 프로젝트 열기: sendya/shadowsocks-panel

보호된 프로퍼티들

프로퍼티 타입 설명
$_address 发件人邮件地址
$_attachment 附件
$_bcc 秘密抄送
$_body 邮件正文
$_cc 抄送
$_errorMessage 错误信息
$_from 发件人
$_isSecurity 是否是安全连接
$_password 邮件传输代理密码
$_port 邮件传输代理服务器端口
$_sendServer 邮件传输代理服务器地址
$_socket socket资源
$_subject 主题
$_to 收件人
$_userName 邮件传输代理用户名

공개 메소드들

메소드 설명
__construct ( )
addAttachment ( string $file ) : boolean 设置邮件附件,多个附件,调用多次
error ( ) : string 返回错误信息
isAvailable ( )
send ( Mail $mail )
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 设置邮件传输代理,如果是可以匿名发送有邮件的服务器,只需传递代理服务器地址就行

보호된 메소드들

메소드 설명
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网络连接

메소드 상세

__construct() 공개 메소드

public __construct ( )

addAttachment() 공개 메소드

设置邮件附件,多个附件,调用多次
public addAttachment ( string $file ) : boolean
$file string 文件地址
리턴 boolean

close() 보호된 메소드

关闭socket
protected close ( ) : boolean
리턴 boolean

closeSecutity() 보호된 메소드

关闭安全socket
protected closeSecutity ( ) : boolean
리턴 boolean

error() 공개 메소드

返回错误信息
public error ( ) : string
리턴 string

getCommand() 보호된 메소드

返回mail命令
protected getCommand ( ) : array
리턴 array

getMIMEType() 보호된 메소드

获取附件MIME类型
protected getMIMEType ( string $file ) : mixed
$file string 文件
리턴 mixed

isAvailable() 공개 메소드

public isAvailable ( )

readFile() 보호된 메소드

读取附件文件内容,返回base64编码后的文件内容
protected readFile ( string $file ) : mixed
$file string 文件
리턴 mixed

send() 공개 메소드

public send ( Mail $mail )
$mail Model\Mail

sendCommand() 보호된 메소드

发送命令
protected sendCommand ( string $command, integer $code ) : boolean
$command string 发送到服务器的smtp命令
$code integer 期望服务器返回的响应吗
리턴 boolean

sendCommandSecurity() 보호된 메소드

安全连接发送命令
protected sendCommandSecurity ( string $command, integer $code ) : boolean
$command string 发送到服务器的smtp命令
$code integer 期望服务器返回的响应吗
리턴 boolean

sendMail() 공개 메소드

发送邮件
public sendMail ( ) : boolean
리턴 boolean

setAddress() 공개 메소드

public setAddress ( $address )

setBcc() 공개 메소드

设置秘密抄送,多个秘密抄送,调用多次
public setBcc ( string $bcc ) : boolean
$bcc string 秘密抄送地址
리턴 boolean

setCc() 공개 메소드

设置抄送,多个抄送,调用多次.
public setCc ( string $cc ) : boolean
$cc string 抄送地址
리턴 boolean

setFrom() 공개 메소드

设置发件人
public setFrom ( string $from ) : boolean
$from string 发件人地址
리턴 boolean

setMail() 공개 메소드

设置邮件信息
public setMail ( string $subject, string $body ) : boolean
$subject string 邮件主体内容,可以是纯文本,也可是是HTML文本
$body string 邮件主题
리턴 boolean

setReceiver() 공개 메소드

设置收件人,多个收件人,调用多次.
public setReceiver ( string $to ) : boolean
$to string 收件人地址
리턴 boolean

setServer() 공개 메소드

设置邮件传输代理,如果是可以匿名发送有邮件的服务器,只需传递代理服务器地址就行
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
리턴 boolean

socket() 보호된 메소드

建立到服务器的网络连接
protected socket ( ) : boolean
리턴 boolean

socketSecurity() 보호된 메소드

建立到服务器的SSL网络连接
protected socketSecurity ( ) : boolean
리턴 boolean

프로퍼티 상세

$_address 보호되어 있는 프로퍼티

发件人邮件地址
protected $_address

$_attachment 보호되어 있는 프로퍼티

附件
protected $_attachment

$_bcc 보호되어 있는 프로퍼티

秘密抄送
protected $_bcc

$_body 보호되어 있는 프로퍼티

邮件正文
protected $_body

$_cc 보호되어 있는 프로퍼티

抄送
protected $_cc

$_errorMessage 보호되어 있는 프로퍼티

错误信息
protected $_errorMessage

$_from 보호되어 있는 프로퍼티

发件人
protected $_from

$_isSecurity 보호되어 있는 프로퍼티

是否是安全连接
protected $_isSecurity

$_password 보호되어 있는 프로퍼티

邮件传输代理密码
protected $_password

$_port 보호되어 있는 프로퍼티

邮件传输代理服务器端口
protected $_port

$_sendServer 보호되어 있는 프로퍼티

邮件传输代理服务器地址
protected $_sendServer

$_socket 보호되어 있는 프로퍼티

socket资源
protected $_socket

$_subject 보호되어 있는 프로퍼티

主题
protected $_subject

$_to 보호되어 있는 프로퍼티

收件人
protected $_to

$_userName 보호되어 있는 프로퍼티

邮件传输代理用户名
protected $_userName