📜  通过 php 代码示例发送电子邮件模板

📅  最后修改于: 2022-03-11 14:54:26.057000             🧑  作者: Mango

代码示例1


    

Send HTML Email Using PHP

This is a HTMl email using PHP by CodexWorld

'; // Set content-type header for sending HTML email $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; // Additional headers $headers .= 'From: CodexWorld' . "\r\n"; $headers .= 'Cc: welcome@example.com' . "\r\n"; $headers .= 'Bcc: welcome2@example.com' . "\r\n"; // Send email if(mail($to,$subject,$htmlContent,$headers)): $successMsg = 'Email has sent successfully.'; else: $errorMsg = 'Email sending fail.'; endif; ?>