<?php
/**
 * This example shows sending a message using PHP's mail() function.
 */

require '../PHPMailerAutoload.php';

//Create a new PHPMailer instance
$mail = new PHPMailer;
//Set who the message is to be sent from
$mail->setFrom('edtledu@gmail.com', 'El foncho');
//Set an alternative reply-to address
$mail->addReplyTo('edtledu@outlook.com', 'El foncho 2');
//Set who the message is to be sent to
$mail->addAddress('edtledu@hotmail.com', 'Eduardo Torres');
//Set the subject line
$mail->Subject = 'Este es un mensaje de prueba';
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
//Replace the plain text body with one created manually
$mail->AltBody = 'Este es el texto plano que corresponde a parte del cuerpo del mensaje.';
//Attach an image file
$mail->addAttachment('images/phpmailer_mini.png');
$mail->addAttachment('images/phpmailer.png');

//send the message, check for errors
if (!$mail->send()) {
    echo "Error en el evio: " . $mail->ErrorInfo;
} else {
    echo "El Mensaje ha sido enviado satisfactoriamente!";
}