【发布时间】:2020-08-06 17:47:25
【问题描述】:
我已配置发送邮件并能够将所有邮件发送给任意数量的用户。 现在我们运行了一个 cronjob,它每周日凌晨 2:00 启动服务器。此 cronjob 将调用我的脚本以重新启动。我创建了一个 html 页面,它动态选择时间和日期,并将其作为 html 格式的电子邮件发送。但是在邮件中没有显示日期和日期。
任何想法如何让它工作???
**My Code**
To: user1@gmail.com
Subject: Application Server Status on host
Content-Type: text/html; charset="us-ascii"
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Gerrit Server Status</title>
</head>
<body>
<p>
<marquee behavior="scroll" bgcolor="yellow" loop="-1" width="30%">
<i>
<font color="blue">
Application Server status :
<strong>
<span id="time"></span>
</strong>
</font>
</i>
</marquee>
<br>
<font color="blue">
Application Server was restarted and the services are up and running.
</p>
<script>
var today = new Date;
document.getElementById('time').innerHTML= today.toDateString();
</script>
</body>
</html>
我收到的电子邮件有以下数据:
Application Server status :
Application Server was restarted and the services are up and running.
在实际的 HTML 页面上,它按预期显示日期和时间。
关于为什么在电子邮件中没有显示日期和时间的任何线索???
谢谢你, 阿尼什
【问题讨论】:
标签: html email dom html-email