本文整理汇总了PHP中Mail::setEmailTo方法的典型用法代码示例。如果您正苦于以下问题:PHP Mail::setEmailTo方法的具体用法?PHP Mail::setEmailTo怎么用?PHP Mail::setEmailTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mail
的用法示例。
在下文中一共展示了Mail::setEmailTo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: request_restore_password
function request_restore_password(){
require_once('conf/location.php');
global $LANG;
global $CONF;
$db = clone $GLOBALS['maindb'];
if (!isset($_GET['user_request_restore_password']))
return array("ok"=>false, error=>"no email");
$user = new RegUser();
$user->setEmail($_GET['user_request_restore_password']); $user->load();
$user_id=$user->getId();
if (empty($user_id))
return array("ok"=>false, "error"=>"no email");
$check=hash('sha512',$user->getEmail().$user->getEncPassword()."Θ");
eval($LANG['requestrestoreemail_body']);
// system("echo \"".$body."\" > email.html");
/*$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=UTF-8\r\n";
$headers .= "From: {$CONF['email_from']}\r\n";
$headers .= "To: {$user->getNickname()} <{$user->getEmail()}>\r\n";
*/
//print_r($body);
require_once('class/Mail.php');
$a=new Mail();
$a->setEmailTo($user->getEmail());
$a->setNicknameTo($user->getNickname());
$a->setSubject("Pedido de recuperação de senha");
$a->setSubjectMsg("");
$a->setMsg($body);
if ($a->send())
return array("ok"=>true,"error"=>"");
else
return array("ok"=>false,"error"=>"could not send email");
}
示例2: sendEmail
public function sendEmail(){
global $CONF;
global $LANG;
$check=substr(hash('sha512',"`\Θℑ ♣ check".$this->getId()),0,8);
$body='';
eval($LANG['useremail_body']);
//system("echo \"".$body."\" > email.html");
require_once('class/Mail.php');
$a=new Mail();
$a->setEmailTo($this->email);
$a->setNicknameTo($this->nickname);
$a->setSubject("Confirmação de e-mail");
$a->setSubjectMsg("");
$a->setMsg($body);
return $a->send();
//return mail($this->email, "Rapidcoffee", $body, $headers);
}
示例3: send
function send(){
require_once('class/Mail.php');
$a=new Mail();
//SOMENTE TESTE!!! DEPOIS TROCAR A LINHA DE BAIXO PELO COMENTARIO ABAIXO!!!
//$a->setEmailTo("e.rapidcoffee@gmail.com");
$a->setEmailTo($this->to_email);
$a->setNicknameTo($this->to_nickname);
$tmpsubject="Notificação de tópicos";
if (!empty($this->addsubject)) $tmpsubject.=" - ".$this->addsubject;
$a->setSubject($tmpsubject);
$a->setSubjectMsg("Existem atualizações de tópicos para você.");
$a->setMsg($this->body);
$a->send();
/*echo $this->topic_ids;
echo "Para: {$this->to_nickname} {$this->to_email}<br/>";
echo $this->body;
echo "*********************";*/
}
示例4: Mail
require_once('tool/utility.php');
$newpassword=generateRandomPassword();
$user->setPassword($newpassword);
eval($LANG['restoreemail_body']);
//system("echo \"".$body."\" > email.html");
/*$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=UTF-8\r\n";
$headers .= "From: {$CONF['email_from']}\r\n";
$headers .= "To: {$user->getNickname()} <{$user->getEmail()}>\r\n";
*/
require_once('class/Mail.php');
$a=new Mail();
$a->setEmailTo($user->getEmail());
$a->setNicknameTo($user->getNickname());
$a->setSubject("Nova senha");
$a->setSubjectMsg("");
$a->setMsg($body);
if ($a->send()){
$user->save();
$msg=$LANG['restoreemail_message_ok'];
$msgclass="info";
} else {
$msg=$LANG['error'];
$msgclass="error";
}
} else {
$msg=$LANG['error_intrusion'];
$msgclass="error";
示例5: save
public function save(){ //Salva o objeto no BD (se ja foi salvo faz update)
$this->_new=false;
$db = clone $GLOBALS['maindb'];
if (empty($this->subject))
return 'error null subject';
if (empty($this->msg))
return 'error null message';
$isanon=$this->getUserTo()->isAnon();
if ($isanon)
return 'error you cannot send messages to an anonymous user';
if (empty($this->user_from) || $this->user_from==null){
$_from_userid='null';
$_from_anon='null';
} else {
$_from_userid=$this->user_from->getId();
$_from_anon= ($this->user_from->isAnon())?'true':'false';
}
if (!isset($this->id) || ($this->id==null)){ //Insert
$db->query("SELECT nextval('message_id_seq') as id;");
$_gotid_req = $db->fetch();
$_gotid = $_gotid_req['id'];
$db->query("INSERT INTO message(id,subject,msg,user_to_id,user_from_id, user_from_anon) VALUES('{$_gotid}','{$this->getSubject()}','{$this->getMsg()}', '{$this->getUserTo()->getId()}', {$_from_userid}, {$_from_anon});");
$row = $db->fetch();
$this->id = $_gotid;
} else { //Update
$db->query("UPDATE message set msg='{$this->getMsg()}', user_to_id='{$this->getUserTo()->getId()}',user_from_id={$_from_userid}, user_from_anon={$_from_anon} WHERE id='{$this->id}';");
$row = $db->fetch();
}
$this->setId($this->getId()); $this->load();
require_once('class/Mail.php');
$a=new Mail();
$a->setEmailTo($this->getUserTo()->getEmail());
$a->setNicknameTo($this->getUserTo()->getNickname());
$a->setSubject($this->getSubject());
$a->setSubjectMsg("");
$a->setMsg($this->getMsg());
$a->send();
//mail($this->getUserTo()->getEmail(), '[RapidCoffee] '.$this->getSubject(), $this->getMsg(), $headers);
$this->_flush=true;
return "ok";
}