setFrom('from@example.com'); //Set an alternative reply-to address $mail->addReplyTo('replyto@example.com'); //Set who the message is to be sent to $mail->addAddress(addslashes($_POST['inputEmail'])); //Set the subject line $mail->Subject = 'PHPMailer sendmail test'; $html = file_get_contents('email-templates/default.html'); $css = file_get_contents('email-templates/default.css'); // Merge css into html (inline-style) for compatibility. $emogrifier = new Pelago\Emogrifier(); $emogrifier->setHtml($html); $emogrifier->setCss($css); $mergedHtml = $emogrifier->emogrify(); // Filter content to prevent attacks. To block external images, switch false to true. HTMLFilter($mergedHtml, '', false); //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($mergedHtml, dirname(__FILE__), true); //Replace the plain text body with one created manually // $mail->AltBody = 'This is a plain-text message body'; //send the message, check for errors if (!$mail->send()) { $out = '

Mailer Error: ' . $mail->ErrorInfo . '

' . " \n"; $out .= '

Email sending failed. Please review your php.ini settings

' . " \n"; } else { $out = '

Message sent!

' . " \n"; } } ?> Email sending test

Email sending test