PHP Sending Email Sending HTML Email Using PHPMailer



$mail = new PHPMailer();

$mail->From     = "";
$mail->FromName = "Full Name";
$mail->addReplyTo("", "Reply Address");
$mail->addAddress("", "Recepient Name");
$mail->Subject  = "Subject Text";
$mail->Body     = "<html><body><p><b>This paragraph is bold.</b></p><p><i>This text is italic.</i></p></body></html>";
$mail->AltBody = "This paragraph is not bold.\n\nThis text is not italic.";

if($mail->send()) {
    // Success! Redirect to a thank you page. Use the
    // POST/REDIRECT/GET pattern to prevent form resubmissions
    // when a user refreshes the page.
    header('Location:', true, 303);
else {
    echo "Error: " . $mail->ErrorInfo;