从HTML格式发送电子邮件,而不是文本
我试图发送email每1小时从cron作业正在执行一个php脚本,从数据库中提取数据,并以表格格式显示。 我有CentOs 6.1在哪里我创build了我的cron作业。首先我从terminalyum install cronie我键入crontab -e并打开VI编辑器 在那里我把我的cron与MAILTO一样 MAILTO="[email protected]" 10 * * * * php /var/www/html/myfile.php 它发送电子邮件每1小时过去10分钟,但其发送电子邮件中的文本内容,我不想要的。 myfile.php <?php $con=mysql_connect("localhost","root",""); mysql_select_db("dbname",$con); $to="[email protected]" $subject = 'Count User Login And Application'; //fetch between 06:00:00 to 08:30:00 09:00:00 to 10:00:00 $date=array('06:00:00','09:00:00'); $date1=array('08:30:00','10:00:00'); $msg = '<html><head>'; $msg .='<title>Some Title</title>'; $msg .='</head>'; $msg .='<h1>Test User</h1>'; $msg .='<table border="1" cellspacing="1">'; $msg .= […]