CMXX - Mailer update
This commit is contained in:
@@ -50,19 +50,31 @@ function send_mail($to, $subject, $message, $attachment, $attachment_name){
|
||||
|
||||
$mail = new PHPMailer();
|
||||
$mail->CharSet = 'UTF-8';
|
||||
//$mail->isSMTP(); // Use SMTP protocol
|
||||
$mail->isSMTP(); // Use SMTP protocol
|
||||
$mail->Host = email_host_name; // Specify SMTP server
|
||||
$mail->SMTPAuth = true; // Auth. SMTP
|
||||
$mail->Username = email; // Mail who send by PHPMailer
|
||||
$mail->Password = email_outgoing_pw; // your pass mail box
|
||||
$mail->SMTPSecure = email_outgoing_security; // Accept SSL
|
||||
$mail->Port = email_outgoing_port; // port of your out server
|
||||
$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;
|
||||
$mail->setFrom(email, mail_from); // Mail to send at
|
||||
$mail->addAddress($to); // Add sender
|
||||
$mail->addReplyTo(email_reply_to); // Adress to reply
|
||||
$mail->isHTML(true); // use HTML message
|
||||
$mail->Subject = $subject;
|
||||
$mail->Body = $message;
|
||||
|
||||
/* +++++++++++ //
|
||||
// DEBUG MODE //
|
||||
// +++++++++++ //
|
||||
$mail->SMTPDebug = 4; // Or higher if needed
|
||||
$mail->Debugoutput = function($str, $level) {
|
||||
debuglog($str); // Your custom logger
|
||||
};
|
||||
// +++++++++++ //
|
||||
// +++++++++++ */
|
||||
|
||||
if (!empty($attachment) || $attachment != ''){
|
||||
$mail->AddStringAttachment($attachment, $attachment_name, 'base64', 'application/pdf');
|
||||
}
|
||||
@@ -71,7 +83,7 @@ function send_mail($to, $subject, $message, $attachment, $attachment_name){
|
||||
if( !$mail->send() ){
|
||||
// render error if it is
|
||||
$tab = array('error' => 'Mailer Error: '.$mail->ErrorInfo );
|
||||
echo json_encode($tab);
|
||||
debuglog(json_encode($tab));
|
||||
exit;
|
||||
}
|
||||
else{
|
||||
|
||||
BIN
assets/images/media/67fbd985069a0_hotspringworld-42.webp
Normal file
BIN
assets/images/media/67fbd985069a0_hotspringworld-42.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 55 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 368 KiB |
BIN
assets/images/media/680744f05b2a3_hotspringworld-42.webp
Normal file
BIN
assets/images/media/680744f05b2a3_hotspringworld-42.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 55 KiB |
BIN
assets/images/media/680745332942c_Recent-Projects-Image-1.png
Normal file
BIN
assets/images/media/680745332942c_Recent-Projects-Image-1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 464 KiB |
58
assets/mail/email_template_contactform.php
Normal file
58
assets/mail/email_template_contactform.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
defined($security_key) or exit;
|
||||
|
||||
$message = '
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>' . $mail_subject . '</title>
|
||||
<style>
|
||||
@media screen and (max-width: 600px) {
|
||||
.content {
|
||||
width: 100% !important;
|
||||
display: block !important;
|
||||
padding: 10px !important;
|
||||
}
|
||||
.header, .body, .footer {
|
||||
padding: 20px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body style="font-family: Arial, sans-serif">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td align="center" style="padding: 20px;">
|
||||
<table class="content" width="600" border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse; border: 1px solid #cccccc;">
|
||||
<!-- Header -->
|
||||
<tr>
|
||||
<td class="header" style="background-color:'.color.'; padding: 40px; text-align: center; color: white; font-size: 24px;">
|
||||
'.site_name.'
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Body -->
|
||||
<tr>
|
||||
<td class="body" style="padding: 40px; text-align: left; font-size: 16px; line-height: 1.6;">
|
||||
' . $mail_subject . ',
|
||||
<br>
|
||||
<br>
|
||||
'.$mail_content.'
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Footer -->
|
||||
<tr>
|
||||
<td class="footer" style="background: url(\'https://'.$portalURL.emaillogo.'\');background-position: center center;background-repeat:no-repeat;background-size:contain;background-color: '.color.'; padding: 40px;">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
';
|
||||
Reference in New Issue
Block a user