-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction_page.php
47 lines (36 loc) · 1.88 KB
/
action_page.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
<?php
include('session.php');
require 'php/PHPMailerAutoload.php';
include 'php/functions.php';
$mail = new PHPMailer;
//$mail->SMTPDebug = 3; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.gmail.com;smtp-relay.gmail.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = '[email protected]'; // SMTP username
$mail->Password = 'arkham2016'; // SMTP password
$mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 465; // TCP port to connect to
$mail->setFrom('[email protected]', 'Condominus SA');
$mail->addAddress('pedrofilipe_17@hotmail', 'Pedro Palha'); // Add a recipient
//$mail->addAddress('[email protected]', 'Pedro Palha'); // Name is optional
$mail->addReplyTo('[email protected]', 'Information');
//$mail->addCC('[email protected]');
//$mail->addBCC('[email protected]');
//$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
//$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = 'Novo Registo';
$mail->Body = 'This is the HTML message body <b>in bold!</b> and your password is:' . $mailpw;
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
if ($mail->send()) {
echo "<script type=\"text/javascript\">".
"alert('Enviado com sucesso');"
. "window.location = 'menu.php';".
"</script>";
}
else{
echo 'ERROR';
}
$connection->close();
?>