Untitled

mail@pastecode.io avatar
unknown
php
a year ago
1.6 kB
2
Indexable
Never
<?php

use PHPMailer\PHPMailer\Exception;
use PHPMailer\PHPMailer\PHPMailer;

require 'PHPMailer/src/Exception.php';
require 'PHPMailer/src/PHPMailer.php';
require 'PHPMailer/src/SMTP.php';

$subject = '1+ Studio';

$messege = "
            <html>
                <body style='background-color: #eee; font-size: 16px;'>
                <div style='min-width: 200px; background-color: #ffffff; padding: 20px; margin: auto;'>
                    <h3 style='color:black'>電郵回覆內容</h3>
                    <p style='color:black;'>
                    感謝閣下完成預約程序。<br/>
                    預約費用支付經確認後,會在入場前兩小時以短訊及whatsapp發送給閣下已登記之手機號碼。<br/>
                    再次感謝閣下選擇本館,希望使用過程開心,下次再見。
                    </p>
                </div>
                </body>
            </html>";


$sender_name = "1+ Studio";
$sender_email = "test@1-studiohk.com";
//
$username = "test@1-studiohk.com";
$password = "123Qweasd!@#";
//
$receiver_email = 'frogbidofficial@gmail.com';


$mail = new PHPMailer(true);
$mail->isSMTP();
//$mail->SMTPDebug = 2;
$mail->Host = 'sgp52.siteground.asia';

$mail->SMTPAuth = true;

$mail->SMTPSecure = 'tls';

$mail->Port = 465;

$mail->setFrom($sender_email, $sender_name);
$mail->Username = $username;
$mail->Password = $password;

$mail->Subject = $subject;
$mail->msgHTML($messege);
$mail->addAddress($receiver_email);

if (!$mail->send()) {
    echo 'Mail Send';
} else {
    echo 'Mail not Send';
}