forked from pablasso/DevHouser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsend_email.php
42 lines (32 loc) · 1.32 KB
/
send_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
<?php
if ( empty($_POST['name']) || empty($_POST['work']) )
{
echo "Por lo menos dinos quien eres y que planeas hacer anda :)";
exit();
}
require_once 'class.phpmailer.php';
$mail = new PHPMailer();
$body = "<p>Nombre: {$_POST['name']}</p>";
$body .= "<p>Twitter: {$_POST['twitter']}</p>";
$body .= "<p>Va a trabajar: {$_POST['work']}</p>";
$body = eregi_replace("[\]",'',$body);
$mail->IsSMTP(); // telling the class to use SMTP
$mail->SMTPDebug = 0; // enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only
$mail->SMTPAuth = true;
$mail->Host = "minube.smtp.com"; // SMTP server
$mail->Username = "[email protected]";
$mail->Password = "b49Dk6lq";
$mail->SetFrom('[email protected]', 'Juan Pablo Ortiz Arechiga');
$mail->Subject = "Registro para Guadalajara DevHouse #2";
$mail->AltBody .= "No HTML: {$_POST['name']}, {$_POST['twitter']}, {$_POST['work']}";
$mail->MsgHTML($body);
$address = "[email protected]";
$mail->AddAddress($address, "Juan Pablo Ortiz Arechiga");
if( !$mail->Send() ) {
echo "Oops, ocurrió un problema al enviar tus datos por lo pronto puedes enviarlos a [email protected]";
} else {
echo "¡Gracias! En cuanto lo revisemos te agregamos a la lista.";
}
?>