-
Notifications
You must be signed in to change notification settings - Fork 0
/
pix_email.php
65 lines (57 loc) · 2.12 KB
/
pix_email.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
use App\Controller\ApostilasController;
require 'vendor/autoload.php';
$mail = new PHPMailer(true);
try {
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->Username = 'marcosviniciusjahu@gmail.com';
$mail->Password = '';
$mail->SMTPSecure = 'tls';
$mail->Port = 587;
$mail->setFrom('marcosviniciusjahu@gmail.com', 'Marcos Vinicius');
$mail->addAddress($email, $fullName);
$mail->Subject = mb_encode_mimeheader('Falta pouco para concluir sua compra com pix! ');
$mail->isHTML(true);
$mail->Body = "
<html>
<head> <style>
@font-face {
font-family: 'Forum', serif;
src: url('https://fonts.googleapis.com/css2?family=Forum&display=swap');
font-family: 'Forum', serif;
src: url('https://fonts.googleapis.com/css2?family=Montserrat&display=swap');
}
body {
background:url(/View/Imagens/fundo_celular.png);
}
h1{
font-family: 'Forum', serif;
src: url('https://fonts.googleapis.com/css2?family=Forum&display=swap');
}
h2 {
font-weight: bold;
font-family: 'Forum', serif;
src: url('https://fonts.googleapis.com/css2?family=Forum&display=swap');
}
p {
src:url('https://fonts.googleapis.com/css2?family=Montserrat&display=swap');
}
</style></head>
<body>
<h1>Olá $fullName</h1>
<p>Falta pouco para concluir sua compra! 🚀</p>
<h2> Copie esse código no app do seu banco: $id</p>
<h4>Atenciosamente,<br>Equipe do Inglês Aqui</h4>
</body>
</html>
";
$mail->send();
echo 'E-mail enviado com sucesso!';
} catch (Exception $e) {
echo "Erro ao enviar o e-mail: {$mail->ErrorInfo}";
}
?>