1, QQ mailbox or 163 mailbox to open the SMTP service, get the authorization code, according to your own
QQ mailbox opens SMTP service
163 mailbox opens SMTP service
126 mailbox opens SMTP service, the same as 163.
2. Website background - system - system basic parameters - core settings
Website sending EMAIL: [email protected]
or [email protected]
Whether to enable SMTP to send mail: 是
SMTP server: ssl://smtp.163.com
or ssl://smtp.qq.com
SMTP server port: 465
SMTP server user mailbox: [email protected]
or [email protected]
SMTP server user account: dedehtml
or 858265175
SMTP server user password: 填你邮箱授权码,不是邮箱登录密码
configure 163 mailbox is like this
Configure QQ mailbox This is the way to
configure 126 mailboxes like this
3. Website background - system - system basic parameters - add new variables
Variable Name: cfg_shoujianren
Variable Type: 文本
Parameter Description: 收件人
Variable Value: [email protected]
Group: As shown in the 站点设置
figure
4. Open /plus/diy.php and find
$id = $dsql->GetLastID();
add below it
$mailtitle = "{$diy->name}--留言通知";
$mailbody = '';
foreach($diy->getFieldList() as $field=>$fieldvalue)
{
$mailbody .= "{$fieldvalue[0]}:{${$field}}\r\n";
}
$headers = "From: ".$cfg_adminemail."\r\nReply-To: ".$cfg_adminemail;
if($cfg_sendmail_bysmtp == 'Y' && !empty($cfg_smtp_server))
{
$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_shoujianren,$cfg_webname ,$cfg_smtp_usermail, $mailtitle, $mailbody, $mailtype);
}
else
{
@mail($cfg_shoujianren, $mailtitle, $mailbody, $headers);
}
At this point, the custom form sends an email to notify the administrator that it is completed