forked from ligeirinho/Netflix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmail.php
116 lines (92 loc) · 3.48 KB
/
mail.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
ini_set('display_errors',1);
require("PHPMailer/class.phpmailer.php");
require("PHPMailer/class.smtp.php");
//https://www.google.com/settings/security/lesssecureapps
//http://phpmailer.worxware.com/
function send($correo,$nombre,$descripcion)
{
$mail = new PHPMailer() ;
$body = '<table width="537" height="662" border="1">
<tbody>
<tr>
<td width="253" height="94">Buenas tardes señor '.$nombre.'</td>
<td width="557">'.$descripcion.'</td>
</tr>
<tr>
<td colspan="2"><img src="http://www.comolohicieron.com.mx/wp-content/uploads/2015/03/Screen-Shot-2015-03-29-at-3.36.49-PM-816x497.png"></td>
</tr>
</tbody>
</table>';
$body .= "";
$mail->IsSMTP();
//Sustituye (ServidorDeCorreoSMTP) por el host de tu servidor de correo SMTP
$mail->Host = "mail.comolohicieron.com.mx";
$mail->Port = 587;
$mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
//Sustituye ( CuentaDeEnvio ) por la cuenta desde la que deseas enviar por ejem. [email protected]
$mail->From = "[email protected]";
$mail->FromName = "Martin Flores";
$mail->Subject = "Hola este es una prueba de mail";
$mail->AltBody = "Leer";
$mail->MsgHTML($body);
// Sustituye (CuentaDestino ) por la cuenta a la que deseas enviar por ejem. [email protected]
$mail->AddAddress($correo,'');
$mail->SMTPAuth = true;
// Sustituye (CuentaDeEnvio ) por la misma cuenta que usaste en la parte superior en este caso [email protected] y sustituye (ContraseñaDeEnvio) por la contraseña que tenga dicha cuenta
$mail->Username = "[email protected]";
$mail->Password = "********";
if($mail->Send())
{
//return true;
return $body;
}else
{
return false;
die();
}
}
function sendgmail($correo,$nombre)
{
$mail = new PHPMailer() ;
$body = '<table width="537" height="662" border="1">
<tbody>
<tr>
<td width="253" height="94">Buenas tardes señor '.$nombre.'</td>
<td width="557">Por medio de este presente correo...... bla bla bal....</td>
</tr>
<tr>
<td colspan="2"><img src="http://www.comolohicieron.com.mx/wp-content/uploads/2015/03/Screen-Shot-2015-03-29-at-3.36.49-PM-816x497.png"></td>
</tr>
</tbody>
</table>';
$body .= "";
$mail->IsSMTP();
//Sustituye (ServidorDeCorreoSMTP) por el host de tu servidor de correo SMTP
$mail->Host = "smtp.gmail.com";
$mail->Port = 465;
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
//Sustituye ( CuentaDeEnvio ) por la cuenta desde la que deseas enviar por ejem. [email protected]
$mail->From = "[email protected]";
$mail->FromName = "Marti Flores";
$mail->Subject = "Hola este es una prueba de mail";
$mail->AltBody = "Leer";
$mail->MsgHTML($body);
// Sustituye (CuentaDestino ) por la cuenta a la que deseas enviar por ejem. [email protected]
$mail->AddAddress($correo,'');
$mail->SMTPAuth = true;
// Sustituye (CuentaDeEnvio ) por la misma cuenta que usaste en la parte superior en este caso [email protected] y sustituye (ContraseñaDeEnvio) por la contraseña que tenga dicha cuenta
$mail->Username = "[email protected]";
$mail->Password = "*******";
if($mail->Send())
{
return $body;
}else
{
return false;
die();
}
}
$html = send($_POST['correo'],$_POST['nombre'],$_POST['descripcion']);