Opcion 1: http://blog.unijimpe.net/enviar-email-con-php-y-gmail/
Opción 2: http://gidsoft.org/como-configurar-wampserver-para-enviar-correos/
SMTP GMAIL
Código PHP:
1. $mail->Host = 'smtp.gmail.com';
2. $mail->Port = 465;
3. $mail->SMTPAuth
= true;
4. $mail->Username = 'tu_usuario_gmail@gmail.com';
5. $mail->Password = 'tu_clave_gmail';
SMTP HOTMAIL
Código PHP
1. $mail->Host = 'smtp.live.com';
2. $mail->Port = 25;
3. $mail->SMTPAuth
= true;
4. $mail->Username = 'tu_usuario_hotmail@hotmail.com';
5. $mail->Password = 'tu_clave_hotmail';
Descripción del comando mail: http://php.net//manual/es/function.mail.php
bool mail ( string
$to , string $subject , string $message [, string$additional_headers [, string $additional_parameters ]] )Ejemplo:
<h2>Feedback Form</h2>
<?php
// display form if user has not clicked submit
if (!isset($_POST["submit"])) {
?>
<form method="post" action="<?php echo $_SERVER["PHP_SELF"];?>">
From: <input type="text" name="from"><br>
Subject: <input type="text" name="subject"><br>
Message: <textarea rows="10" cols="40" name="message"></textarea><br>
<input type="submit" name="submit" value="Submit Feedback">
</form>
<?php
} else { // the user has submitted the form
// Check if the "from" input field is filled out
if (isset($_POST["from"])) {
$from = $_POST["from"]; // sender
$subject = $_POST["subject"];
$message = $_POST["message"];
// message lines should not exceed 70 characters (PHP rule), so wrap it
$message = wordwrap($message, 70);
// send mail
mail("webmaster@example.com",$subject,$message,"From: $from\n");
echo "Thank you for sending us feedback";
}
}
?>
