fix(Send Mail): add utf-8 support

This commit is contained in:
cubic
2022-03-14 11:32:57 +08:00
parent 1989bc9a5e
commit 384ce83ed4
4 changed files with 8 additions and 6 deletions

View File

@@ -12,7 +12,8 @@ class Mail {
);
$from = YAML_EMAIL_NAME . '<' . YAML_EMAIL_FROM . '>';
$result = exec("echo -e '{$body}' | mail -r '{$from}' -s '{$title}' '{$to}'");
$result = exec("export LANG=en_US.UTF-8 && echo -e '{$body}' | mail -r '{$from}' -s '{$title}' '{$to}' > /dev/null &");
Logger::Log(
'from:' . $from . ' Sent result:' . json_encode($result),

View File

@@ -79,7 +79,7 @@ jQuery.validator.addMethod("regexTel",
, "格式错误"); // addMethod第3个参数:默认错误信息
var validateMobileCodeTimes = 0;
var tickingSecond = 60;
var tickingSecond = 120;
var key = '<?php echo $key; ?>'
var mode = '<?php echo $mode; ?>'
@@ -212,7 +212,7 @@ function startTicking() {
tickingSecond --;
} else {
$('#btn_get_code').text('<?php echo lang('user_form_get_code_re')?>').removeAttr('disabled').removeClass('color-grey');
tickingSecond = 60;
tickingSecond = 120;
}
}

View File

@@ -38,7 +38,7 @@ swapon /root/swap
```shell
# 安装基础软件包
yum install -y sudo tcl tk gettext autoconf gcc cmake3 wget initscripts openssh-server crontabs mailx pcre pcre-devel libcurl libcurl-devel libxml2 libxml2-devel openssl openssl-devel sqlite sqlite-devel libpng libpng-devel libwebp libwebp-devel libjpeg libjpeg-devel libXpm libXpm-devel freetype freetype-devel oniguruma oniguruma-devel libyaml libyaml-devel
yum install -y sudo tcl tk gettext autoconf gcc cmake3 wget initscripts openssh-server crontabs mailx sendmail pcre pcre-devel libcurl libcurl-devel libxml2 libxml2-devel openssl openssl-devel sqlite sqlite-devel libpng libpng-devel libwebp libwebp-devel libjpeg libjpeg-devel libXpm libXpm-devel freetype freetype-devel oniguruma oniguruma-devel libyaml libyaml-devel
```
除此之外,你还需要安装 `libzip 1.7+` 库,需要去官网下载源码包解压后安装。
@@ -234,6 +234,7 @@ sh ./remove_test_data.sh
```shell
chkconfig mariadb on # 或 chkconfig mysql on (根据安装的数据库类型, 如果使用云服务忽略此项目)
chkconfig sendmail on
chkconfig nginx on
chkconfig php-fpm on
chkconfig codefever on

View File

@@ -106,7 +106,7 @@ class UserSettingEmail extends React.Component {
validationEmail: null,
code: '',
codeDisabled: false,
count: 61
count: 121
}
const { intl } = props
@@ -244,7 +244,7 @@ class UserSettingEmail extends React.Component {
this.setState({ codeDisabled: true, count: --count })
window.setTimeout(() => this.countDown(), 1000)
} else {
this.setState({ codeDisabled: false, count: 61 })
this.setState({ codeDisabled: false, count: 121 })
}
}