使用wxparse解析html
items.BODYTEXT='<!DOCTYPE html><html><head><title></title><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />\n<style>\nh1{font-size:18px}\nh2{font-size:16px}\nh3{font-size:14px}\nh4,h5,h6{font-size:100%}\ntable{border-collapse:collapse;border-spacing:0;font-size:12px}\nth,td,p{margin:0;padding:0}\n.read-latter-header{padding:10px 20px}\n.read-latter-header h1 a:link,.read-latter-header h1 a:hover,.read-latter-header h1 a:visited{font-weight:lighter;font-size:12px;margin-left:20px}\n.read-latter-header h1 span{font-weight:lighter;font-size:12px;margin-top:8px}\n.read-latter-header h5,.read-latter-header h6{font-weight:lighter;padding-top:10px}\nem.skin{font-weight:700}\n.latter{padding:30px}\n.latter h1{font-weight:lighter;padding-bottom:10px}\n.latter table{width:700px}\n.latter td,.latter th{padding:5px}\n.latter p{padding:2px 0}\n.borgray,table.borgray td,table.borgray th{border:1px solid #ccc}\n.bgwarn{background-color:#FFFFD8}\n</style>\n</head>\n\n<body>\n<div class=\"body\">\n<div class=\"latter\">\n<h1>很抱歉您发送的邮件被退回来了,以下是该邮件的相关信息。</h1>'
核心代码:
运行效果
求教怎么样式也显示在页面了呢?