* @param string $replyname Replyer * @param string $replymail Reply address * @return array(bealoon,string) The returned array includes two elements, and bealoon indicates whether it was successful or not. , string is the prompt information */ function SendMail($send_to_mail,$subject ,$body,$extra_hdrs,$username,$replyname="reply",$replymail="reply@reply.com"){ $mail=new PHPMailer(); $mail->IsSMTP( ); //Email sending method $mail->Host="smtp.host.com"; //SMTP server host address $mail->SMTPAuth=true; //Whether it is trusted SMTP $mail->Username="reply@reply.com"; //SMTP username Note: Ordinary email authentication does not require adding @domain name $mail->Password="***** *"; //SMTP user password $mail->From="send@send.com"; //Sender's email address $mail->FromName="send"; //Send To $mail->CharSet="GB2312"; //Specify character set $mail->Encoding="base64"; $mail->AddAddress($send_to_mail,$username ); //Add destination address $mail->AddReplyTo($replymail,$replyname); //Add reply address $mail->IsHTML(true); //Email type is HTML format $mail->Subject=$subject; //Email subject //Email content $mail->Body="
".$body."
"; $mail->AltBody="text/html"; //Content text format if (@!$mail->Send()) { $results=array("result"=>false,"message"=>$mail->ErrorInfo ); return $results; }else{ $results = array("result"=>true,"message"=>"The email has been sent to {$send_to_mail}! "); return $results; } }
The old mail() is no longer popular, so I will put the most recently used examples as memories. Copy the code The code is as follows: ?php require_once(dirname(__FILE__)."/../phpmailer/class.phpmailer...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn