Here i try to create a process to sent email from server..after i click button save/send, there always server error 500 appear..anyone cant help me fix it..
<?php
include('../include/dbconn.php');
include('PHPMailer/PHPMailerAutoload.php');
require('PHPMailer/class.PHPMailer.php');
$to = $_POST['email_to'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$img = $_FILES["img"]["name"];
$from = "info@internationaltimes.com.my";
$cc = $_POST['email_cc'];
$bcc = $_POST['email_bcc'];
$headers .= "From: $from \r\n";
$headers .= "Reply-To: $from \r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
//SET EMAIL PRIORITY
//$headers .= "X-Priority: 1 (Highest)\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "Importance: High\n";
$add = mysql_query($conn, "INSERT INTO email_sent_inbox set sent_time = now(), sender = '$_POST[username]', mailto = '$_POST[email_to]', cc = '$_POST[email_cc]', bcc = '$_POST[email_bcc]', mail_subject = '$_POST[subject]', message = '$_POST[message]'" or die (mysql_error());
if($add){
$retval = mail ($to,$subject,$message,$header);
if($retval)
{
echo "<script>window.location='newsletter_blasting.php';</script>";
}
}
?>