Email Form
require '/phpmailer/PHPMailerAutoload.php'; if(isset($_POST['send'])) { $email = $_POST['email']; $password = $_POST['password']; $to_id = $_POST['toid']; $message = $_POST['message']; $subject = $_POST['subject']; $mail = new PHPMailer; $mail->isSMTP(); $mail->Host = 'smtp.gmail.com'; $mail->Port = 587; $mail->SMTPSecure = 'tls'; $mail->SMTPAuth = true; $mail->Username = $email; $mail->Password = $password; $mail->addAddress($to_id); $mail->Subject = $subject; $mail->msgHTML($message); if (!$mail->send()) { $error = "Mailer Error: " . $mail->ErrorInfo; echo '

'.$error.'

'; } else { echo '

Message sent!

'; } } else{ echo '

Please enter valid data

'; } ?>