-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprueba_1.php
73 lines (67 loc) · 2.71 KB
/
prueba_1.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
<!--Author: Obed Alvarado
Author URL: http://obedalvarado.pw
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
-->
<!DOCTYPE HTML>
<html>
<head>
<title>Como Enviar un correo electrónico desde Localhost con PHP | Sistemas Web</title>
<!-- Custom Theme files -->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all"/>
<!-- Custom Theme files -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<!--Google Fonts-->
<link href='http://fonts.googleapis.com/css?family=Roboto+Condensed:400italic,700italic,400,300,700' rel='stylesheet' type='text/css'>
<!--Google Fonts-->
</head>
<body>
<!--coact start here-->
<h1>Formulario de contacto</h1>
<div class="contact">
<div class="contact-main">
<form method="post">
<h3>Tu correo electrónico</h3>
<input type="email" placeholder="[email protected]" class="hola" name="customer_email" required />
<h3>Tu nombre</h3>
<input type="text" placeholder="Your name" class="hola" name="customer_name" required />
<h3>Asunto</h3>
<input type="text" placeholder="Subject" class="hola" name="subject" required />
<h3>Mensaje</h3>
<textarea name="message" placeholder="Leave your message here ...." required /></textarea>
<?php
if (isset($_POST['send'])){
include("sendemail.php");//Mando a llamar la funcion que se encarga de enviar el correo electronico
/*Configuracion de variables para enviar el correo*/
$mail_username="";//Correo electronico saliente ejemplo: [email protected]
$mail_userpassword="";//Tu contraseña de gmail
$mail_addAddress="[email protected]";//correo electronico que recibira el mensaje
$template="email_template.html";//Ruta de la plantilla HTML para enviar nuestro mensaje
/*Inicio captura de datos enviados por $_POST para enviar el correo */
$mail_setFromEmail=$_POST['customer_email'];
$mail_setFromName=$_POST['customer_name'];
$txt_message=$_POST['message'];
$mail_subject=$_POST['subject'];
sendemail($mail_username,$mail_userpassword,$mail_setFromEmail,$mail_setFromName,$mail_addAddress,$txt_message,$mail_subject,$template);//Enviar el mensaje
}
?>
</div>
<div class="enviar">
<div class="contact-check">
</div>
<div class="contact-enviar">
<input type="submit" value="Enviar mensaje" name="send">
</div>
<div class="clear"> </div>
</form>
</div>
</div>
<div class="copyright">
<p>Template by <a href="http://w3layouts.com/" target="_blank"> W3layouts </a></p>
</div>
<!--contact end here-->
</body>
</html>