Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $name = trim( $_POST['name'] );
- $email = trim( $_POST['email'] );
- $subject = trim( $_POST['subject'] );
- $message = trim( $_POST['message'] );
- $message = "
- \n $name \n
- \n $email \n
- \n $subject \n
- \n $message \n
- ";
- echo $message;
- include "PHPMailer_5.2.4/class.phpmailer.php";
- $mail = new PHPMailer;
- $mail->isSMTP();
- $mail->Host = 'webh.email';
- $mail->SMTPAuth = true;
- $mail->Username = 'cenzura';
- $mail->Password = 'cenzura';
- $mail->SMTPSecure = 'tls';
- $mail->Port = 587;
- $mail->setFrom('cenzura', 'Mailer');
- $mail->addAddress($_email, 'Name');
- $mail->addAttachment('fileaddress');
- $mail->isHTML(true);
- $mail->Subject = 'formularz';
- $mail->Body = $message;
- $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
- if($mail->send()) {
- echo 'success'; }
- else
- { echo 'unsuccess'; }
- }
- else // not validated
- {
- echo 'error';
- }
- // end if
- }
- else // BOT DETECTED - lets lie to it
- {
- //echo "Thanks, We'll get back to you as soon as possible";
- echo 'success';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement