📅  最后修改于: 2022-03-11 14:54:17.051000             🧑  作者: Mango
Hello ";
$mail = new PHPMailer(true);
try {
//Server settings
$mail->isSMTP();
$mail->Host = 'smtp.titan.email';
$mail->SMTPAuth = true;
$mail->Username = 'contact@domain.com';
$mail->Password = 'password';
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;
//Recipients
$mail->setFrom('contact@domain.com', 'domain Team');
$mail->addAddress('receiver1@gmail.com', 'Joe User');
$mail->addAddress('receiver2@gmail.com', 'Joe User');
// Attachments
// Content
$mail->isHTML(true);
$mail->Subject = 'Here is the subject';
$mail->Body = $html;
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
$mail->send();
echo true;
} catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}