修改发送邮件方式
This commit is contained in:
parent
ba6040f16a
commit
7133de2456
@ -40,7 +40,7 @@ static int error_log(float l_t, int c_t, char *log_file, char *recv_mail, int _i
|
|||||||
// 关机活重启时
|
// 关机活重启时
|
||||||
sprintf(temperature, "%d.%d.%d %d:%d:%d %s %.3f℃ %s %.3f℃\n", (1900 + tmp_ptr->tm_year), (1 + tmp_ptr->tm_mon), tmp_ptr->tm_mday, tmp_ptr->tm_hour, tmp_ptr->tm_min, tmp_ptr->tm_sec, "Raspberry CPU temperature", l_t, "Restartable or shutdown temperature",
|
sprintf(temperature, "%d.%d.%d %d:%d:%d %s %.3f℃ %s %.3f℃\n", (1900 + tmp_ptr->tm_year), (1 + tmp_ptr->tm_mon), tmp_ptr->tm_mday, tmp_ptr->tm_hour, tmp_ptr->tm_min, tmp_ptr->tm_sec, "Raspberry CPU temperature", l_t, "Restartable or shutdown temperature",
|
||||||
(float)c_t);
|
(float)c_t);
|
||||||
sprintf(buffer, "email -r %s -s \"Raspberrypi Temperature\" -t \"%s\"", recv_mail, temperature);
|
sprintf(buffer, "gomail -r %s -s \"Raspberrypi Temperature\" -t \"%s\"", recv_mail, temperature);
|
||||||
fp = popen(buffer, "r");
|
fp = popen(buffer, "r");
|
||||||
pclose(fp);
|
pclose(fp);
|
||||||
fp = NULL;
|
fp = NULL;
|
||||||
@ -48,7 +48,7 @@ static int error_log(float l_t, int c_t, char *log_file, char *recv_mail, int _i
|
|||||||
// 正常温度时
|
// 正常温度时
|
||||||
if (tmp_ptr->tm_min >= 10 && tmp_ptr->tm_min < 12) {
|
if (tmp_ptr->tm_min >= 10 && tmp_ptr->tm_min < 12) {
|
||||||
sprintf(temperature, "%d.%d.%d %d:%d:%d %s:%.3f℃\n", (1900 + tmp_ptr->tm_year), (1 + tmp_ptr->tm_mon), tmp_ptr->tm_mday, tmp_ptr->tm_hour, tmp_ptr->tm_min, tmp_ptr->tm_sec, "Raspberry CPU temperature", l_t);
|
sprintf(temperature, "%d.%d.%d %d:%d:%d %s:%.3f℃\n", (1900 + tmp_ptr->tm_year), (1 + tmp_ptr->tm_mon), tmp_ptr->tm_mday, tmp_ptr->tm_hour, tmp_ptr->tm_min, tmp_ptr->tm_sec, "Raspberry CPU temperature", l_t);
|
||||||
sprintf(buffer, "email -r %s -s \"Raspberrypi Temperature\" -t \"%s\"", recv_mail, temperature);
|
sprintf(buffer, "gomail -r %s -s \"Raspberrypi Temperature\" -t \"%s\"", recv_mail, temperature);
|
||||||
fp = popen(buffer, "r");
|
fp = popen(buffer, "r");
|
||||||
pclose(fp);
|
pclose(fp);
|
||||||
fp = NULL;
|
fp = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user