/** * @param $content */ public function sendMail($content) { $mail = new PHPmailer(); $mail->isSMTP(); $mail->SMTPDebug = 1; $mail->CharSet = 'utf-8'; $mail->Host = 'smtp.163.com'; $mail->SMTPAuth = true; $mail->Username = '******'; $mail->Password = '******'; //$mail->SMTPSecure = false; $mail->Port = 25; $mail->From = '*****@*****.**'; $mail->FromName = '12306提醒'; $mail->addAddress('*****@*****.**'); $mail->isHTML(true); $mail->Subject = '居然还有票~'; $mail->Body = $content . '<br /><br /><br /><a href="https://kyfw.12306.cn/otn/lcxxcx/init">赶紧去12306抢票吧~</a>'; if (!$mail->send()) { echo 'Message could not be sent.'; echo 'Mailer Error: ' . $mail->ErrorInfo; } else { echo 'Message has been sent'; } }