Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(isset($_POST['send'])){
- $name = $_POST['sendName'];
- $email = $_POST['sendEmail'];
- $subject = $_POST['sendSubject'];
- $message = $_POST['sendMessage'];
- $password = $_POST['sendPass'];
- require_once('phpmailer/class.phpmailer.php');
- require_once('phpmailer/class.smtp.php');
- $mail = new PHPMailer(); // create a new object
- $mail->IsSMTP(); // enable SMTP
- $mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
- $mail->SMTPAuth = true; // authentication enabled
- //$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for Gmail
- $mail->Priority = 1; // Highest priority - Email priority (1 = High, 3 = Normal, 5 = low)
- $mail->CharSet = 'UTF-8';
- $mail->Host = "smtp.postmarkapp.com";
- $mail->Port = 2525; // or 587 //or 25
- $mail->IsHTML(true);
- $mail->Username = $email;
- $mail->Password = $password;
- $mail->From = $email;
- $mail->Subject = $subject;
- $mail->Body = $message;
- $mail->AddAddress("teste2x2016@gmail.com","jon");
- if(!$mail->Send()) {
- echo "Mailer Error: " . $mail->ErrorInfo;
- } else {
- echo "Message has been sent";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement