Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once('../class.phpmailer.php');
- //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
- try {
- $mail = new PHPMailer();
- $mail->Host = "relay-hosting.secureserver.net"; // your SMTP Server
- $mail->IsSMTP();
- $mail->SMTPDebug = true;
- $mail->SMTPAuth = false; // Auth Type
- $mail->SMTPSecure = "ssl";
- $mail->Username = "email@mydomain.com";
- $mail->Password = "password";
- $mail->Sender = "email@mydomain.com";
- $mail->From = "email@mydomain.com";
- $mail->AddReplyTo("email@mydomain.com");
- $mail->FromName = "myname";
- $mail->AddAddress("email@mydomain.com");
- //$mail->AddAddress("desired recipient no.2 optional");
- $mail->IsHTML(true);
- $mail->Subject = "Test Email";
- $mail->Body = "The email was successfully sent!";
- $mail->WordWrap = 50;
- $mail->Send();
- echo"<script>alert('The Form has been posted ,Thank you');window.location='index.html'</script>";
- } catch (phpmailerException $e) {
- echo $e->errorMessage(); //Pretty error messages from PHPMailer
- } catch (Exception $e) {
- echo $e->getMessage(); //Boring error messages from anything else!
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement