Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once('emclass/PHPMailerAutoload.php');
- $mail = new PHPMailer;
- $mail->SMTPDebug = 0; // Enable verbose debug output
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'mail.wingsuguesthouse.com'; // Specify main and backup SMTP servers
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'info@wingsuguesthouse.com'; // SMTP username
- $mail->Password = 'Wingsu01'; // SMTP password
- $mail->SMTPSecure = 'none'; // Enable TLS encryption, `ssl` also accepted
- $mail->Port = 587; // TCP port to connect to
- $mail->SMTPAutoTLS = false;
- $mail->Hostname = "uvcms1.pusathosting.info";
- $name = $_POST['name'];
- $email = $_POST['email'];
- $subject = $_POST['subject'];
- $message = $_POST['message'];
- $mail->setFrom('info@wingsuguesthouse.com', 'Message from Website');
- $mail->addAddress('info@wingsuguesthouse.com'); // Add a recipient // Name is optional
- $mail->addReplyTo($email);
- $mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
- $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
- $mail->isHTML(true); // Set email format to HTML
- $mail->Subject = $subject;
- $mail->Body = "From: ".$name." <br> E-Mail: ".$email." <br> Subject: ".$subject." <br> Message:<br> ".$message."";
- if ($_POST['submit']) {
- if(!$mail->send()) {
- echo 'Message could not be sent.';
- echo 'Mailer Error: ' . $mail->ErrorInfo;
- }else{
- echo '<p>Your message has been sent! We will reply your email soon.</p>';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement