織夢dedecms提交留言表單資訊自動傳送到郵箱

黄文Rex發表於2024-07-23
程式碼部分
找到
$query = "INSERT INTO `{$diy->table}` (`id`, `ifcheck` $addvar)  VALUES (NULL, 0 $addvalue); ";
在下方新增程式碼
$mailtitle = "提交表單通知";
$mailbody = "姓名:{$name}\r\n郵箱:{$email}\r\n內容:{$content}";
$headers = $cfg_adminemail;
$mailtype = 'TXT';
require_once(DEDEINC.'/mail.class.php');
$smtp = new smtp($cfg_smtp_server,$cfg_smtp_port,true,$cfg_smtp_usermail,$cfg_smtp_password);
$smtp->debug = false;
$smtp->sendmail($cfg_smtp_usermail,$cfg_webname ,$cfg_smtp_usermail, $mailtitle, $mailbody, $mailtype);

相關文章