选择语言 :

 Core_Email::to

Set Recipients

Email Core_Email::to( string $to )

参数列表

参数 类型 描述 默认值
$to string
返回值
  • Email
File: ./core/classes/email.class.php
public function to($to)
{
    $to = $this->_str_to_array($to);
    $to = $this->clean_email($to);

    if ($this->validate)
    {
        $this->validate_email($to);
    }

    if ($this->_get_protocol() !== 'mail')
    {
        $this->set_header('To', implode(', ', $to));
    }

    switch ($this->_get_protocol())
    {
        case 'smtp':
            $this->_recipients = $to;
        break;
        case 'sendmail':
        case 'mail':
            $this->_recipients = implode(', ', $to);
        break;
    }

    return $this;
}