Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("phpmailer/class.phpmailer.php");
- if ( isset($_POST["send"]) )
- {
- $to = $_POST['to'];
- $subject = $_POST['subject'];
- $sender = $_POST['sender'];
- $website = $_POST['website'];
- $template = empty($_POST['template']) ? null : $_POST['template'];
- $sendername = $_POST['sendername'];
- if ( empty($template) )
- die('Missing template.');
- $template = file_get_contents('./Templates/'.$template.'.html');
- $template = str_replace('%%LINK%%', $website, $template);
- $mail = new PHPMailer();
- $mail->IsSMTP();
- $mail->CharSet = 'UTF-8';
- $mail->Host = "smtp.gmail.com";
- $mail->SMTPAuth= true;
- $mail->Port = 587; // Or Port 465 if with out TLS
- $mail->Username= "EMAILHERE!";
- $mail->Password= "notallowed";
- $mail->SMTPSecure = 'ssl';
- $mail->send();
- $headers .= "X-Priority: 1 (Highest)\n";
- $headers .= "X-MSMail-Priority: High\n";
- $headers .= "Importance: High\n";
- $headers = "MIME-Version: 1.0" . "\r\n";
- $headers .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";
- //mail( $to, $subject,$mail, $template, $headers);
- if(!$mail->send()){
- echo "<script>alert('Mail sent!'); </script>";
- }
Add Comment
Please, Sign In to add comment