$departe = $_POST["departe"];
$asunto = $_POST["asunto"];
$dest = $_POST["dest"];
$msg = $_POST["msg"];
$adjn = $_POST["adjn"];
$_FILES["archivo"] = $_POST['adj']; // aca esta ricibiendo la ruta donde se encuentra el archivo en la pc
$nombre = $_POST["nombre"];
require 'PHPMailerAutoloader.php';
$mail = new PHPMailer;
//$mail->SMTPDebug = 3; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.gmail.com;'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = '
[email protected]'; // SMTP username
$mail->Password = 'Spina38615385'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587; // TCP port to connect to
$mail->From = $departe;
$mail->FromName = $nombre;
$mail->addAddress($dest, $nombre); // Add a recipient
//$mail->addAddress('
[email protected]'); // Name is optional
$mail->addReplyTo($departe, 'Information');
//$mail->addCC('
[email protected]');
//$mail->addBCC('
[email protected]');
$mail->WordWrap = 50; // Set word wrap to 50 characters
$mail->addAttachment($_FILE['archivo'], $adjn); // Add attachments
//$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = $asunto;
$mail->Body = $msg;
//$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
if(!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'si';
}