no message

This commit is contained in:
2025-10-18 14:46:52 +08:00
commit 7a84025b05
387 changed files with 75711 additions and 0 deletions

58
user/email.php Normal file
View File

@@ -0,0 +1,58 @@
<?php
include './cgp.php';
// 示例使用
// 引入 PHPMailer 的文件
require 'phpmailer/src/PHPMailer.php';
require 'phpmailer/src/SMTP.php';
require 'phpmailer/src/Exception.php';
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
function sendMail($to,$subject,$content) {
$mail = new PHPMailer(true); // 实例化PHPMailer对象
try {
// 邮件服务器配置
$mail->isSMTP(); // 使用SMTP
$mail->Host = '127.0.0.1'; // SMTP服务器地址
$mail->Username = 'cloud@fuxsto.cn'; // SMTP用户名
$mail->Password = ''; // SMTP密码
$mail->SMTPAutoTLS = false; // 禁用自动TLS
$mail->SMTPSecure = ''; // 确保没有加密
$mail->Port = 25; // SMTP端口号
// 发件人和收件人
$mail->setFrom('cloud@fuxsto.cn', 'Fuxsto Mail'); // 发件人
$mail->addAddress($to, $to); // 收件人
// 邮件内容
$mail->isHTML(true); // 设置邮件格式为HTML
$mail->Subject = $subject;
$mail->Body = $content; // HTML格式的邮件内容
$mail->AltBody = $content; // 如果收件人客户端不支持HTML则显示此内容
// 发送邮件
$mail->send();
return 200;
} catch (Exception $e) {
return "邮件发送失败,错误信息: {$mail->ErrorInfo}";
}
}