You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
3.3 KiB
80 lines
3.3 KiB
<?php
|
|
use PHPMailer\PHPMailer\PHPMailer;
|
|
use PHPMailer\PHPMailer\SMTP;
|
|
use PHPMailer\PHPMailer\Exception;
|
|
require 'vendor/autoload.php';
|
|
|
|
function sendEmail($toEmail, $toName, $subject, $body) {
|
|
|
|
$mail = new PHPMailer(true);
|
|
|
|
try {
|
|
//$mail->SMTPDebug = SMTP::DEBUG_SERVER;
|
|
$mail->isSMTP();
|
|
$mail->Host = 'smtp.mail.eu-west-1.awsapps.com';
|
|
$mail->SMTPAuth = true;
|
|
$mail->Username = 'ordini@iolovolio.com';
|
|
$mail->Password = 'VoliO878889+';
|
|
$mail->SMTPSecure = "ssl";
|
|
$mail->Port = 465;
|
|
|
|
$mail->setFrom('ordini@iolovolio.com', 'IoLovOlio');
|
|
$mail->addAddress(trim($toEmail), "$toName");
|
|
|
|
$mail->isHTML(true);
|
|
$mail->Subject = $subject;
|
|
$mail->Body = $body;
|
|
//$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
|
|
|
|
$mail->send();
|
|
return true;
|
|
} catch (Exception $e) {
|
|
return $mail->ErrorInfo;
|
|
}
|
|
}
|
|
|
|
function emailHeader() {
|
|
return '<!doctype html>
|
|
<html xmlns="https://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
|
|
<head>
|
|
<!--[if (gte mso 9)|(IE)]mn:keepcomment>
|
|
<style type="text/css">
|
|
.hideOutlook{ mso-hide: all; overflow: hidden; max-height: 0; width: 0; display: none; line-height: 0; visibility: hidden;}
|
|
</style>
|
|
<![endif]mnkeepcomment -->
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>IoLovOlio</title>
|
|
</head>
|
|
<body style="background: #F5F2F0; color: #323232; font-family: Arial, Helvetica, sans-serif; font-weight: 400; margin: 0; overflow-x: hidden;">
|
|
<!--[if mso]>
|
|
<table align="center" border="0" cellpadding="0" cellspacing="0" width="600"><tr><td>
|
|
<![endif]-->
|
|
<table align="center" border="0" cellpadding="0" cellspacing="0" style="max-width: 600px; margin: 0 auto; width: 100%; background: #FFF; border-top: 5px solid #92704F";">
|
|
<tr style="margin: 0; padding: 0;">
|
|
<td style="height: 80px; margin: 0; padding: 15px; text-align: center;">
|
|
<img alt="IoLovOlio" src="https://iolovolio.com/images/logoHeader.png" width="200">
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table align="center" border="0" cellpadding="10" cellspacing="0" style="max-width: 600px; margin: 0 auto; width: 100%; background: #FFF; border-bottom: 5px solid #92704F; color: #000; font-size: 16px">';
|
|
}
|
|
|
|
|
|
function emailFooter() {
|
|
return '</table><table align="center" border="0" cellpadding="0" cellspacing="15" style="color: #323232; font-size: 12px; margin: 0 auto; padding: 10px 0; text-align: center; width: 100%;">
|
|
<tr style="margin: 0; padding: 0;">
|
|
<td style="margin: 0; padding: 0;">
|
|
<span style="color: #323232; font-size: 12px; padding: 5px 15px">© IoLovOlio</span>
|
|
<a style="color: #323232; font-size: 12px; padding: 5px 15px" href="https://iolovolio.com/provacy">Privacy Policy</a>
|
|
<a style="color: #323232; font-size: 12px; padding: 5px 15px" href="https://iolovolio.com/termini">Termini del servizio</a>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<!--[if mso]></td></tr></table><![endif]-->
|
|
</body>
|
|
</html>';
|
|
}
|
|
|
|
?>
|