<?php
session_start();
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'PHPMailer/src/Exception.php';
require 'PHPMailer/src/PHPMailer.php';
require 'PHPMailer/src/SMTP.php';

header('Access-Control-Allow-Origin: *');

header('Access-Control-Allow-Methods: GET, POST');

header("Access-Control-Allow-Headers: X-Requested-With");




$subject = "Your Verification Code!";
$message = '<!DOCTYPE HTML>     
    <html>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
</head>
<body>
<div style="background-color:#eee; border:solid; border-width:thin; border-color:#EEE; position: relative; font-size:13px; padding-top:2em; padding:1em; font-family:Verdana, Geneva, sans-serif">
<div style="background-color:white; width: 80%; margin:auto; dborder:solid; dborder-width:thin; bdorder-color:#EEE; position: relative; font-size:13px; dtext-align: center; line-height: 20px; padding-top:2em; padding:1.5em; font-family:Verdana, Geneva, sans-serif">
<div style="width: 100%; text-align: center;">
</div>
<p>You just created an account on Findwhosabi.</p>
<p>Your verification code is '.$code.'</p>
</div>
</div>

</body>
</html>';




$mail = new PHPMailer();

$mail->IsSMTP();        // set mailer to use SMTP
$mail->Host = "ssl://smtp.mailgun.org:465";  // specify main and backup server
$mail->SMTPAuth = true;     // turn on SMTP authentication
$mail->Username = 'noreply@fixedincome.fundtronpartners.com';  // SMTP username
$mail->Password = "81a0f5dd39990c55d0dd44afdf6620fb-f68a26c9-b5f877c6"; // SMTP password
$mail->SMTPSecure = 'tls';     // turn on SMTP authentication
$mail->Port = 587;     // turn on SMTP authentication
$mail->SMTPDebug  = 2;   


$mail->setFrom('noreply@fixedincome.fundtronpartners.com', 'FUNDTRON');
$mail->addAddress("daviscool567@gmail.com");
//$mail->addAddress("gbite.aina@gmail.com");
$mail->addBcc("diimtech@gmail.com" );
$mail->Subject = $subject;
$mail->msgHTML($message);


/*$mail1->WordWrap = 50;                                 // set word wrap to 50 characters
//$mail->AddAttachment("/var/tmp/file.tar.gz");         // add attachments
//$mail->AddAttachment("/tmp/image.jpg", "new.jpg");    // optional name
$mail1->IsHTML(true);                                  // set email format to HTML */

$mail->Send();

?>
