-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathposta.php
More file actions
31 lines (27 loc) · 1.01 KB
/
posta.php
File metadata and controls
31 lines (27 loc) · 1.01 KB
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
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<?php
$nome = $_POST['nome'];
$email = $_POST['email'];
$tel = $_POST['tel'];
$assunto = $_POST['assunto'];
$mensagem = $_POST['mensagem'];
require 'vendor/autoload.php';
$from = new SendGrid\Email(null, "erick-poleto@hotmail.com");
$subject = "Mensagem pagina principal";
$to = new SendGrid\Email(null, "erick-poleto@hotmail.com");
$content = new SendGrid\Content("text/html", "Olá, Erick <br><br>mensagem pagina pessoal");
$mail = new SendGrid\Mail($from, $subject, $to, $content);
//Necessário inserir a chave
$apiKey = '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';
$sg = new \SendGrid($apiKey);
$response = $sg->client->mail()->send()->post($mail);
echo "mensagem enviada com sucesso";
?>
</body>
</html>