-
Notifications
You must be signed in to change notification settings - Fork 0
/
prueba_email.php
35 lines (31 loc) · 1.21 KB
/
prueba_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
<?php
require_once 'src/lib/php_mailer/PHPMailerAutoload.php';
$Mail = new PHPMailer();
$Mail->IsSMTP(); // Use SMTP
$Mail->Host = "smtp.gmail.com"; // Sets SMTP server
$Mail->SMTPDebug = 2; // 2 to enable SMTP debug information
$Mail->SMTPAuth = TRUE; // enable SMTP authentication
$Mail->SMTPSecure = "tls"; //Secure conection
$Mail->Port = 587; // set the SMTP port
//$Mail->Username = '[email protected]'; // SMTP account username
$Mail->Username = '[email protected]';
$Mail->Password = '*******'; // SMTP account password
$Mail->Priority = 1; // Highest priority - Email priority (1 = High, 3 = Normal, 5 = low)
$Mail->CharSet = 'UTF-8';
$Mail->Encoding = '8bit';
$Mail->Subject = 'Asunto';
$Mail->ContentType = 'text/html; charset=utf-8\r\n';
$Mail->From = '[email protected]';
$Mail->FromName = 'TITULO MAS COPADO - ALERTAAAAAA!';
$Mail->WordWrap = 900; // RFC 2822 Compliant for Max 998 characters per line
$Mail->AddAddress('[email protected]'); // To:
$Mail->isHTML(TRUE);
$Mail->Body = '<h2>Hola Diego. Andá a programar.</h2>';
$Mail->AltBody = 'Programar';
$Mail->Send();
$Mail->SmtpClose();
if ($Mail->IsError()) {
echo "ERROR<br /><br />";
} else {
echo "OK<br /><br />";
}