Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include ("class.phpmailer.php");
- $mail = new PHPMailer();
- $mail->IsSMTP(); // set mailer to use SMTP
- $mail->Host = "mail.domain.com"; // specify main and backup server
- $mail->SMTPAuth = true; // turn on SMTP authentication
- $mail->Username = "mailer@domain.com"; // SMTP username
- $mail->Password = "PASSWORD"; // SMTP password
- $mail->From = "mailer@domain.com"; //do NOT fake header. The Username domain and the from domain must be the same.
- $mail->FromName = "GreenLam";
- $mail->AddAddress("user1@domain.com"); // Email on which you want to send mail
- $mail->AddReplyTo("user1@domain.com", "Support and Help"); //optional
- $mail->IsHTML(true);
- $mail->Subject = "Contact Us Form";
- $mail->Body = "This is a test form";
- $mail->SMTPDebug = 1;
- if(!$mail->Send())
- {
- echo $mail->ErrorInfo;
- }else{
- echo "Thank You for submitting your comments. Our staff will contact you shortly!";
- }
- ?>
Add Comment
Please, Sign In to add comment