What friends have been watching for a while because he does not send the mail to the recipient, I have the fragment in the action of a form, but not fulfilling the condition I jump to the error "Message body empty", see if can anybody help me. Thanks
<?php
function sendmail($setFromEmail,$setFromName,$addReplyToEmail,$addReplyToName,$addAddressEmail,$addAddressName,$subject,$template){
require 'class.phpmailer.php';
$mail = new PHPMailer;
$mail->isSendmail();
$mail->setFrom($setFromEmail, $setFromName);
$mail->addReplyTo($addReplyToEmail, $addReplyToName);
$mail->addAddress($addAddressEmail, $addAddressName);
$mail->Subject = $subject;
$mail->msgHTML(file_get_contents($template));
if (!$mail->send()) {
echo "Error al enviar mensaje: " . $mail->ErrorInfo;
} else {
echo "Mensaje enviado!";
}}sendmail('[email protected]','quien envia','[email protected]','a quien responde','[email protected]','quien recibe','Prueba piloto','confirmation.html');?>