issmtp(); // send via smtp $mail->host = 200.162.244.66; // smtp servers $mail->smtpauth = true; // turn on smtp authentication $mail->username = yourmail; // smtp username 注意:普通邮件认证不需要加 @域名 $mail->password = mailpassword; // smtp password $mail->from = yourmail@yourdomain.com; // 发件人邮箱 $mail->fromname = 管理员; // 发件人 $mail->charset = gb2312; // 这里指定字符集! $mail->encoding = base64; $mail->addaddress($sendto_email,username); // 收件人邮箱和姓名 $mail->addreplyto(yourmail@yourdomain.com,yourdomain.com); //$mail->wordwrap = 50; // set word wrap 换行字数 //$mail->addattachment(/var/tmp/file.tar.gz); // attachment 附件 //$mail->addattachment(/tmp/image.jpg, new.jpg); $mail->ishtml(true); // send as html // 邮件主题 $mail->subject = $subject; // 邮件内容 $mail->body = i love php