1, liuyan.php as follows:
Include ("class.phpmailer.php");
Include ("class.smtp.php");
Just fill in the information and you can ****************************
$SMTP = "smtp.163.com";//required, set SMTP server QQ mailbox is smtp.qq.com, QQ mailbox default is not open, please set up in the mailbox open. NetEase is smtp.163.com or smtp.126.com.
$youremail = ' 123@163.com '; Required, open the SMTP service mailbox, that is, sender email.
$password = "123456"; Required, the password for the above mailbox
$ymail = "su.li1001@163.com"; The email address of the addressee, which is the e-mail you receive.
$yname = "Jaguar Technology"; Recipient Salutation
Fill in the information end ****************************
function Get_ip () {
if (getenv ("Http_client_ip") && strcasecmp (getenv ("Http_client_ip"), "Unknown")
$ip = getenv ("Http_client_ip");
else if (getenv ("Http_x_forwarded_for") && strcasecmp (getenv ("Http_x_forwarded_for"), "Unknown")
$ip = getenv ("Http_x_forwarded_for");
else if (getenv ("REMOTE_ADDR") && strcasecmp (getenv ("REMOTE_ADDR"), "Unknown")
$ip = getenv ("REMOTE_ADDR");
else if (isset ($_server[' remote_addr ')) && $_server[' remote_addr '] && strcasecmp ($_server[' Remote_ ADDR '], "unknown"))
$ip = $_server[' remote_addr ');
Else
$ip = "Unknown";
return ($IP);
}
$mail = new Phpmailer ();
$mail->issmtp ();
$mail->smtpauth = true;
$mail->host = $SMTP;
$mail->username = $youremail;
$mail->password = $password; Required, the password for the above mailbox
$mail->from = $youremail;
$mail->fromname = "Feedback system";
$mail->addaddress ($ymail, $yname);
if ($_post[' yourname ']) {
$yourname = $_post[' yourname ');
$tel = $_post[' Tel '];
$QQ = $_post[' QQ '];
$email = $_post[' email '];
$message = $_post[' message '];
$ip = Get_ip ();
$mail->subject = $yourname. " -"Message Feedback";
$html = ' name: '. $yourname. '
Phone: '. $tel. '
QQ: '. $qq. '
Email: '. $email. '
IP: '. $ip. '
Content: '. $sm;
$mail->msghtml ($html);
$mail->ishtml (TRUE);
if (! $mail->send ()) {
Echo ';
} else {
Echo ';
}
}
?>
<title>Feedback-by huoduan.com</title>
Message Feedback
<< Back Home
Please fill in the following content
by Jaguar Technology
Reply to discussion (solution)
You did not pass the certification:
1: Confirm that your $youremail/$password is correct
2: Confirm that your mailbox has opened the POP3/SMTP service function, see if you receive a Setup wizard mail in your mailbox
Simplify and annotate all functions and styles
Send an ABC to another mailbox first.