请问谁有发送邮件的那个网页 HTML 源代码

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了请问谁有发送邮件的那个网页 HTML 源代码相关的知识,希望对你有一定的参考价值。

就是你登录邮箱点发送邮件,然后出来的那个页面,有发件人、主题、内容等文本框的那个页面。我需要那个页面的源代码,含代样式表js最好。我上 163 和 QQ 上去另存为网页,都保存不下来。请问哪位有代码或者有办法把那个网页保存下来的,请帮助我!谢谢!
我给发了一个图,就是如图网页的源代码,需要 CSS 和 js 文件。

163的很容易保存:点写信以后,在写信的标题附近空白处点鼠标右键,选择查看源文件,就会打开一个记事本,里面就是网页代码,从文件内容可以看见CSS代码文件是<link href="http://mimg.126.net/p/js31style/lib/0902091535/jscss/globle.css" rel="stylesheet" type="text/css" id="cssGlobe">,JS代码很多,163的代码的前面部分如下:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>网易电子邮箱</title>
<script language="javascript" src="http://mimg.126.net/external/product163.js"></script>
<script language="javascript" src="http://mimg.126.net/external/public163.js"></script>
<script language="javascript">var style= \'21\';var uid = \'134931@163.com\';var sid = \'ZCNYFPVKCrOsHwiKRWKKoVxaZzKKPxua\';var contentURL = "readhtml.jsp?ssid=L%2ffJIM1fCEcjz7AdjHYrPVsp5POa3TQPSlvidcrLLkY%3d";var host = location.hostname;var searchid = "false";var domain = "163.com";var limitMessageCount = "999999999";var attrs = common: sid : sid, uid : uid, cosid : "96", now : 1238213857743, style : style , user:\'refuselist\':\'\',\'safelist\':\'\',\'addo\':0,\'afterdel\':1,\'aftersend_saveaddr\':0,\'app_city\':null,\'autosavedraft\':1,\'birthday\':null,\'city\':\'\',\'clearinterval\':0,\'displaysender\':0,\'gender\':\'0\',\'helptips\':\'00000101\',\'huodong_option\':\'00000110\',\'junkfilter\':null,\'junkfriend\':1,\'junkpic\':0,\'junkrefuse\':1,\'keepspamdays\':-1,\'maxlist\':100,\'mms_enabled\':0,\'nick_name\':\'\',\'ntes_defaultsender\':null,\'op_readreceipt\':0,\'replyf\':0,\'save_sent\':1,\'showmusicbar\':0,\'style\':21,\'true_name\':\'阳光\', cos:\'pref_quota\':999999999,\'perm_func_netfolder\':false,\'perm_func_address_book\':true,\'perm_func_schedule_send\':true,\'perm_func_antivirus\':true,\'perm_mail_webmail\':true,\'perm_mail_pop\':true,\'perm_mail_smtp\':true,\'perm_mail_imap\':false,\'perm_mail_filter\':true,\'perm_webmail_sendmail\':true,\'perm_webmail_html_editor\':true,\'perm_webmail_signature\':true,\'pref_webmail_max_signatures\':10,\'perm_webmail_pop_agent\':true,\'perm_webmail_mail_sorting\':true,\'perm_webmail_mail_get_rfc\':true,\'perm_webmail_disp_pref\':true,\'perm_webmail_mail_search\':true,\'pref_smtp_max_num_rcpts\':20,\'pref_smtp_max_send_mail_size\':28672,\'pref_alias_num\':3,\'perm_mail_sms_notify\':true,\'perm_smtp_auth_disabled\':false,\'perm_mail_autoreply\':true,\'perm_mail_autoforward\':true,\'perm_ssl_pop\':false,\'perm_ssl_smtp\':false,\'perm_ssl_imap\':false,\'perm_ssl_http\':false,\'perm_filter_anti_spam\':true,\'pref_antivirus_engine\':\'\',\'pref_smtp_max_recv_mail_size\':28672,\'pref_smtp_max_mail_count\':999999999,\'pref_webmail_style\':\'0=1&0=2&0=3&0=4&0=5&0=6&0=7&0=8&0=9&0=10&0=11&0=12&0=13&0=14&0=15&0=16&0=17&0=18&0=19&0=20&0=21&0=22&0=23&0=24&0=25&0=26&0=27&0=28&0=29&0=30&0=31&0=32&0=33&0=34&0=35&0=0\',\'perm_webmail_voicemail\':false,\'perm_webmail_videomail\':false,\'pref_netfolder_quota\':10,\'pref_netfolder_max_file_size\':10240,\'pref_netfolder_max_file_count\':10000,\'pref_flow_limit\':\'nf:560,nfrcv:476,nfsnd:364,smtp:400,web:500,webrcv:400,websnd:300,pop:250,c_pop:350\',\'perm_share\':false,\'perm_advanced_imaging\':true,\'pref_package_download\':1,\'pref_webmail_faces\':\'@all\',\'perm_mail_fulltext_search\':true,\'perm_ssl\':true,\'perm_webmail_mmmail\':true,\'pref_mail_archive_save_days\':0,\'pref_max_folder_nest_level\':5,\'pref_mail_folders\':100,\'pref_mail_rules\':100,\'pref_pab_contacts\':2000,\'pref_pop_agent_accounts\':8,\'pref_upload_size\':-1,\'pref_webmail_risky_suffix\':\'\';var fixAttrs = afterdel:1,replyf:0,addo:0,displaysender:0,maxlist:20;for(var a in fixAttrs) if(isNaN(attrs.user[a])) attrs.user[a] = fixAttrs[a]; if(!attrs.user.ntes_defaultsender) attrs.user.ntes_defaultsender = uid;</script><script language="javascript"> var gSenders = \'audited\':[],\'unaudited\':[]; var gPopAccounts = []; var gAlias = []; var gFolders = [\'id\':1,\'name\':\'收件箱\',\'flags\':\'system\':true,\'stats\':\'messageCount\':1749,\'messageSize\':1050661745,\'unreadMessageCount\':1481,\'unreadMessageSize\':905264326,\'threadCount\':0,\'unreadThreadCount\':0,\'id\':2,\'name\':\'草稿箱\',\'flags\':\'system\':true,\'stats\':\'messageCount\':0,\'messageSize\':0,\'unreadMessageCount\':0,\'unreadMessageSize\':0,\'threadCount\':0,\'unreadThreadCount\':0,\'id\':3,\'name\':\'已发送\',\'flags\':\'system\':true,\'stats\':\'messageCount\':44,\'messageSize\':40795286,\'unreadMessageCount\':0,\'unreadMessageSize\':0,\'threadCount\':0,\'unreadThreadCount\':0,\'id\':4,\'name\':\'已删除\',\'flags\':\'system\':true,\'stats\':\'messageCount\':0,\'messageSize\':0,\'unreadMessageCount\':0,\'unreadMessageSize\':0,\'threadCount\':0,\'unreadThreadCount\':0,\'id\':5,\'name\':\'垃圾邮件\',\'flags\':\'system\':true,\'stats\':\'messageCount\':0,\'messageSize\':0,\'unreadMessageCount\':0,\'unreadMessageSize\':0,\'threadCount\':0,\'unreadThreadCount\':0,\'id\':6,\'name\':\'病毒文件夹\',\'flags\':\'system\':true,\'stats\':\'messageCount\':0,\'messageSize\':0,\'unreadMessageCount\':0,\'unreadMessageSize\':0,\'threadCount\':0,\'unreadThreadCount\':0,\'id\':7,\'name\':\'广告邮件\',\'flags\':\'system\':true,\'stats\':\'messageCount\':0,\'messageSize\':0,\'unreadMessageCount\':0,\'unreadMessageSize\':0,\'threadCount\':0,\'unreadThreadCount\':0];</script><link href="http://mimg.126.net/p/js31style/lib/0902091535/jscss/globle.css" rel="stylesheet" type="text/css" id="cssGlobe"><script language="javascript"> var gLoginTime = new Date(); var gCurrentCss = "", gCurrentPath = "", gCurrentStyle = null; var gIsDebug = false; var gConfigUrl = "urlconfig.xml"; var gCacheJsPath = "http://mimg.126.net/p/js31style/js/debug/"; function fLoadStyle() var styles = ["http://mimg.126.net/p/js31style/lib/0902091535/cmcss/", "/a/h/js3/"]; gCurrentPath = styles[1]; var cssFile = "vip.163.com" : "163_purple_s.css", "163.com" : "163_blue_s.css", "126.com" : "126_green_s.css", "188.com" : "188_gold_s.css", "yeah.net" : "yeah_blue_s.css" ; for(c in cssFile) if(new RegExp(c).test(location.href)) styles[0] += cssFile[c]; break; gCurrentCss = styles[0]; gCurrentStyle = styles; top.gCurrentCss = gCurrentCss; top.gCurrentStyle = gCurrentStyle; var sCss = \'<link href="\'+ gCurrentCss +\'" rel="stylesheet" type="text/css" id="cssStyle" />\'; if(document.domain.indexOf("163.com")>-1) sCss += \'<link href="http://mimg.126.net/p/js31style/lib/0902091535/images/musicbox/mbox_mini.css" rel="stylesheet" type="text/css"><link href="http://mimg.126.net/musicbox/mbox_gg163.css" rel="stylesheet" type="text/css"><STYLE>.gTopMus .usrMsgtop:10px.gTopMus .tLinktop:10px</STYLE>\'; document.write(sCss); ; var sTopSearchid = searchid; var sTxtKeyValue = "搜索邮件"; if(sTopSearchid && sTopSearchid=="true") sTxtKeyValue = "支持邮件全文搜索"; fLoadStyle(); </script><style>@media all IE\\:CLIENTCAPS behavior:url(#default#clientCaps).userDatabehavior:url(#default#userdata)div.SD_tipsbgbackground-image:url(http://mimg.126.net/assist/res/bbx_tip_vip.png)</style>
</head>
<body class="gb" lang="zh" style="overflow-y:auto">
<div class="gTop gTopMus" id="dvTop"><a href="http://mail.163.com" target="_blank" id="lnkHome"><img src="http://mimg.126.net/logo/163logo.gif" class="gLogo" border="0" id="imgLogo" /></a><div class="usrMsg"><b id="bUid">134931@163.com</b> [ <a href="javascript:fGoto()" onclick="fGoto(\'MM.getModule(\\\'welcome\\\')\')">邮箱首页</a>,<a href="javascript:fGoto()" onclick="fGoto(\'CC.goOutlink(\\\'http://reg.163.com/mob/bindmob0.jsp?username=134931@163.com&url=http://appsms.mail.163.com/bindmo/moorder_163.jsp\\\');\')">密码保护</a>,<a href="javascript:fGoto()" id="lnkexit" onclick="fGoto(\'CC.logout()\')">退出</a> ]  <span id="ad1"></span><span></span></div><div class="tLink"><a href="javascript:fGoto()" onclick="fGoto(\'MM.getModule(\\\'option\\\');\')" >设置</a> | <a href="javascript:fGoto()" id="lnkhelp" target="_blank">帮助</a> | <a href="/a/service/index.jsp?sid=ZCNYFPVKCrOsHwiKRWKKoVxaZzKKPxua" target="_blank">自助查询</a></div><!--页面总导航栏--><div class="gNav"><ul id="ulTab"><li><a href="javascript:fGoto();" class="on" href="javascript:fGoto()" onclick="fGoto(\'MM.getModule(\\\'welcome\\\')\')">电子邮件</a></li><li><a href="javascript:fGoto()" onclick="fGoto(\'MM.getModule(\\\'address\\\');\')">通讯录</a></li><li><a href="javascript:fGoto()" onclick="fGoto(\'CC.getServiceLink(\\\'assist\\\')\')">百宝箱</a></li><li id="liNetFolder"><a href="javascript:fGoto()" onclick="fGoto(\'CC.goNetFolder();\')">网易网盘</a></li></ul></div><div class="gSrh" id="set_a_line_area2"><input type="text" class="gSipt fLe" id="txtKey" style="color:#aaaaaa" onfocus="this.className=\'gSipt fLe bgcolor13\'" MAXLENGTH="100" onkeyup="if(event.keyCode==13)fGoto(\'CC.searchMailByTop();\');this.blur()" onblur="this.className=\'gSipt fLe\';if(this.value==\'\')this.value=sTxtKeyValue;" onclick="if(this.value==sTxtKeyValue)this.value=\'\'" /><a href="javascript:fGoto()" class="srhBtn fLe" onclick="$(\'txtKey\').onclick();fGoto(\'CC.searchMailByTop();\');$(\'txtKey\').onblur();" title="搜索"><b>搜索</b></a><a href="javascript:fGoto();" class="AdsrhBtn fLe" onclick="fGoto(\'MM.getModule(\\\'searchmail\\\');\')" title="进入高级搜索"><b>高级搜索</b></a></div><span id="spnTabSplit"><b id="sl1" class="spl" style="display:none"></b><b id="sl2" class="spl"></b><b id="sl3" class="spl"></b></span></div><div class="gLoading" style="top:34px; right:10px; z-index:60; display:none;" id="tbMsg"><img src="http://mimg.126.net/p/js31style/lib/images/loading_16x16.gif" align="absmiddle"/> <span id="spnMsg">数据加载中,请稍候...</span></div><iframe src="about:blank" id="ifrHtmlEditor" name="ifrHtmlEditor" style="display:none"></iframe><IE:CLIENTCAPS ID="oClientCaps" /><span id="oUserData" class="userData" style="display:none"></span><table class="gMain"><tr class="gMtr"><td class="gLe"><div class="gMbtn" id="set_a_line_area3"><a href="javascript:fGoto();" class="gCmBtn" title="收信" onclick="fGoto(\'CC.goInbox();\')"><b class="hide">收信</b></a><a href="javascript:fGoto();" class="gWmBtn" title="写信" onclick="fGoto(\'CC.compose();\')"><b class="hide">写信</b></a></div><div class="gFd"><h3 class="gfTit"><a href="javascript:fGoto();" class="clsFd bgF1" title="折叠" id="lnkFolderToggle" onclick="fGoto(\'CC.toggleTree($(\\\'lnkFolderToggle\\\'), \\\'ulFolders\\\')\')"></a><a href="javascript:fGoto();" class="gfName" onclick="fGoto(\'MM.getModule(\\\'folderMain\\\')\')">文件夹</a><a href="javascript:fGoto();" class="addFd bgF1" title="添加文件夹" onclick="fGoto(\'MM.folderMain.add()\')"></a></h3><ul class="gFdBdy" id="ulFolders" onmouseover="tryMM.folder.handleDrag();catch(exp)"></ul></div><div class="gFd"><h3 class="gfTit"><a href="javascript:fGoto();" class="clsFd bgF1" id="lnkServiceToggle" title="折叠" onclick="fGoto(\'CC.toggleTree($(\\\'lnkServiceToggle\\\'), \\\'ulService\\\')\')"></a><a href="javascript:fGoto();" class="gfName" onclick="fGoto(\'CC.goOutlink(\\\'/a/h/js3/\\\'+GE.dm+\\\'service.htm\\\')\')">邮箱服务</a></h3><ul class="gSevBdy" id="ulService"><SCRIPT LANGUAGE="JavaScript">var gServiceUrl = \' sms163|http://smsmail.163.com/newsmsmail/LoginEaw163?\\nupgrade163|http://mscan.163.com/pay/payIndex.jsp\\nmyresume|http://event.mail.163.com/jianli/servlet/fenter?origin=$host$&mailname=$user$&sid=$sid$\\n myblog163|http://blog.163.com/apps/notebook/mailnote.do?sid=$sid$&username=$user$&email=$uid$&host=$host$\\nmybill|http://money.mail.$domain$/mybill/user.do?method=login&uid=$uid$&sid=$sid$\\naddress|MM.getModule("address");\\nxport|MM.address.gotoXport();\\npop3|MM.getModule("pop3")\\ncards|http://cards.163.com/mail/index.php?userfrom=mail.$domain$&useremail=$uid$&username=$user$&sid=$sid$&host=$host$\\nrss|http://rss.mail.$domain$/mailrss/mailrss/ul?sid=$sid$&username=$uid$\\nvip163|http://reg.vip.163.com/upgradeFromFreeMail.m?form=163mail\\nstamp|http://stamp.mail.163.com/servlet/stamp?userName=$uid$&sid=$sid$&action=getAlbum\\ninvite|http://uinfo.mail.163.com/fcgi/jisu3/dispinvites.fcgi?sid=$sid$&host=$host$\\nassist|http://mimg.$domain$/assist/index.htm\\necard|http://cards.163.com/mail/index.php?userfrom=mail.$domain$&useremail=$uid$&username=$user$&sid=$sid$&host=$host$\\nmail188|http://reg.mail.188.com/sj188.jsp?uid=$user$&domain=$dm$\\nmyblog|http://blog.163.com/apps/notebook/mailnote.do?sid=$sid$&username=$uid$&email=$uid$&host=$host$\\n\';var gUrls = \' 6|http://alist.mail.163.com/alist_163_ajax/addressbookimport.php?host=$host$\\n11|https://reg.163.com/setinfo/ChangePasswd.jsp?username=$user$\\n12|http://reg.163.com/setinfo/UserInfo.jsp?username=$user$\\n20|http://help.163.com/special/007525G0/163mail_event.html?b08bag1\\n21|http://help.163.com/special/007525G0/163_tran_withdrawal_letter.html?b08bag1\\n22|http://p5.club.163.com/viewBoardByUp.m?boardId=163help&username=$user$\\n23|http://help.163.com/special/007525G0/163mail_ans.html?b08akI1\\n28|http://bbs2.news.163.com/board/postlist.jsp?b=yeah&p=0&l=50\\n29|http://mscan.163.com/pay/payIndex.jsp\\n31|http://pay.126.com/html/payupdate/index.jsp?sid=$sid$\\n35|http://help.163.com/special/007525G0/163mail_index.html?b08akh1\\n55|http://help.163.com/07/0524/13/3F8S6NG9007525G0.html?b08beg1\\n56|http://help.163.com/07/0524/13/3F8S6NG9007525G0_2.html?b08beb1\\n57|http://help.163.com/07/0524/13/3F8S6NG9007525G0_3.html?b08beI1\\n58|http://help.163.com/07/0113/14/34NMRNM2007525G0.html?b08bed1\\n86|http://$host$/a/service/index.jsp?sid=$sid$\\n 33|http://uinfo.mail.163.com/servlet/personal.xsp?sid=$sid$&uid=$uid$&url=http://$host$/a/h/js3/personal.htm&act=get\\n40|http://jslog.mail.126.com/servlet/jslog?style=dm3style&strCmjsLog=\\n46|http://invite.mail.$domain$/servlet/inv?disk=1&sid=$sid$&origin=$host$&username=$user$\\n51|http://alist.mail.$domain$/alist_move/addressbookimport.php\\n53|http://app1.mail.$domain$/sender/servlet/ds?uid=$uid$&sid=$sid$&host=$host$\\n54|http://popmail.mail.$domain$/popmail/servlet/popsmtp?userName=$uid$&sid=$sid$&method=getStatus\\n84|http://uinfo.mail.163.com/fcgi/jisu3/dispinvites.fcgi?sid=$sid$&host=$host$\\n85|http://$host$/a/m/music.htm\\n\';function fTrim(s) return s.replace(/(^\\s*)|(\\s*$)/g, "");var aServiceUrl = gServiceUrl.split("\\n");var aUrls = gUrls.split("\\n");var gServiceUrlObj = ;var gUrlsObj = ;for(var i=0;i<aServiceUrl.length;i++) var v = aServiceUrl[i]; if(v != "") var a = fTrim(v).split("|"); if(a.length == 2) gServiceUrlObj[a[0]] = a[1]; for(var i=0;i<aUrls.length;i++) var v = aUrls[i]; if(v != "") var a = fTrim(v).split("|"); if(a.length == 2) gUrlsObj[a[0]] = a[1]; </SCRIPT><LI id=myblog163><A class=gfNm onfocus=this.blur(); onclick="fGoto(\'CC.getServiceLink(\\\'myblog163\\\');\')" href="javascript:fGoto();">记事本</A></LI><LI id=stamp><A class=gfNm onfocus=this.blur(); onclick="fGoto(\'CC.getServiceLink(\\\'stamp\\\');\')" href="javascript:fGoto();">集邮中心</A></LI><LI id=sms163><A style="FONT-WEIGHT: bold" class=gfNm onfocus=this.blur(); onclick="fGoto(\'CC.getServiceLink(\\\'sms163\\\');\')" href="javascript:fGoto();">随身邮</A></LI><LI id=upgrade163><A class=gfNm onfocus=this.blur(); target=_blank href="#" onclick="this.href=gServiceUrlObj[\'upgrade163\']">新邮箱伴侣</A></LI><!--LI id=vip163><A class=gfNm onfocus=this.blur(); target=_blank href="#" onclick="this.href=gServiceUrlObj[\'vip163\']">升级到VIP</A></LI--></ul></div></td><td class="gRi" id="divMain"><div id="divwelcome"><div class="WelPages"><div class="wel_Topbar" id="divWelcomeHead"><div class="wel_user"><b class="wel_hi_user"><span id="spnWelcomeGreet">中午好</span>,杨光彬</b><div class="w_jifen"><div id="divWelcomeJiFen">  <a href="javascript:fGoto()" onclick="fGoto(\'CC.getJifen()\')" title="点击查看积分">点击查看积分</a></div></div></div><div class="wel_inbox"><b class="icos iconinbox"></b><div class="fLe">您有 <a style="text-decoration:none" href="javascript:fGoto()" onclick="fGoto(\'MM.folder.sortSearch(1,1)\');return false"><span id="spnWelcomeNew" class="Notice_Nu">1481</span></a> 封 <a href="javascript:fGoto()" onclick="fGoto(\'MM.folder.sortSearch(1,1)\');return false">未读邮件</a>,<a href="javascript:fGoto()" onclick=fGoto("MM.getModule(\'folderMain\')")>管理文件夹</a></div><iframe src="http://blog.163.com/blogentry/blogmsg/?uid=134931@163.com&sid=ZCNYFPVKCrOsHwiKRWKKoVxaZzKKPxua&action=new" frameborder="0" allowtransparency="true" scrolling="no" class="ifm_mailblog"></iframe></div><div class="wel_Tr"><div class="wel_rl_nolim" title="无限容量空间:已用1.02G"></div><div id="divWelTianQi"><iframe class="wel_i_weather" frameborder="0" allowtransparency="true" scrolling="no" src="http://mimg.163.com/tianqi/city_js/090328/555/55591_wet_js.htm"></iframe></div></div></div><div class="wel_Main_Main" id="divWelcomeBody"><div class="wel_Main"><div class="wel_Mtab"><div class="wel_Mtab_head" id="divWelcomeTab"><script>fAdPageWrite(fAdWelcomeTabsInfo)</script></div><div class="wel_i_bg" id="divWelcomeContent"><span><div class="weltab_main_f"><div class="img1"><script>fAdPageWrite(fAdWelcomeRandom(fAdWelcomeServiceLogo))</script></div><div class="txt1"><script>fAdPageWrite(fAdWelcomeRandom(fAdWelcomeServiceText))</script></div></div><div class="wel_if_mail" style="text-align:center"><div class="wel_tj"><div class="wel_tj_tit"><script>t=fAdWelcomeServiceLink();fAdPageWrite(t.title)</script></div><ul class="wel_tj_ul"><li><script>fAdPageWrite(t.left1)</script></li><li><script>fAdPageWrite(fAdWelcomeRandom(fAdWelcomeServiceLinkR1))</script></li><li><script>fAdPageWrite(t.left2)</script></li><li><script>fAdPageWrite(fAdWelcomeRandom(fAdWelcomeServiceLinkR2))</script></li><li><script>fAdPageWrite(t.left3)</script></li><li><script>fAdPageWrite(fAdWelcomeRandom(fAdWelcomeServiceLinkR3))</script></li></ul></div></div><div class="clear" style="height:1px"></div></span></div></div><div class="wel_Ma300x260"><script>fAdPageWrite(fAdWelcomeRandom(fAdWelcome300x260))</script></div><div class="wel_Ma460x110"><div class="wel_Ma460x110M"><div class="wel_gjcont
参考技术A 别用163的,浏览器兼容性很差
而且大部分网页保存下来再运行都是有错的

shell发送网页邮件


部分IP打码 请谅解~




邮件发送格式 :
    echo "cat html"|mail -s "$(echo -e "check node number Content-Type:text/html;charset=utf-8")" -r "grouplist_node_check" [email protected]
由mail -s指定发送的内容为html类型。

内容模板 (建议在Dreamweaver、PyCharm等工具编辑好预览OK后使用)
==============================================
<html>
    <body>
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
          <style> table{border-collapse: collapse;border-spacing: 0;background-color: transparent;} .table {width: 100%; max-width: 100%; margin-bottom: 20px; } .table > tbody > tr > td{padding: 8px; line-height: 1.42857143; vertical-align: top; border-top: 1px solid #dddddd; } .table-condensed > tbody > tr > td { padding: 5px; } .table-bordered { border: 1px solid #dddddd; } .table-bordered > tbody > tr > td { border: 1px solid #dddddd; } .table-bordered > thead > tr > td { border-bottom-width: 2px; } .table-striped > tbody > tr:nth-child(odd) { background-color: #f9f9f9; } table > tbody > tr.warning > td { background-color: #fcf8e3; } .panel { margin-bottom: 20px; background-color: #ffffff; border: 1px solid transparent; border-radius: 4px; -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); } .panel-body { padding: 15px; } .panel-heading { padding: 10px 15px; border-bottom: 1px solid transparent; border-top-right-radius: 3px; border-top-left-radius: 3px; }  .panel-title { margin-top: 0; margin-bottom: 0; font-size: 16px; color: inherit; } .panel-warning > .panel-heading { color: #8a6d3b; background-color: #fcf8e3; border-color: #faebcc; } .panel-danger { border-color: #ebccd1; } .panel-danger > .panel-heading { color: #a94442; background-color: #f2dede; border-color: #ebccd1; } .fenzu{color: #5fc4f6} .num{color: #f65f5f} td{text-align: center;}
          </style>
          <div class="panel panel-danger">
               <div class="panel-heading">
                    <h3 class="panel-title">分组信息</h3>
               </div>
               <div class="panel-body">
                    <table class="table table-bordered" style="margin: 0 60px; width: 520px; height: 41px;">
                    <tbody><tr class="warning" style="height: 30px">
                         <td style="width: 140px"><b style="color: #3c3c3c">分组名称</b></td>
                         <td style="width: 50px"><b style="color: #3c3c3c">节点个数</b></td>
                         </tr>
                         </tbody>
                    </table>
               </div>
          </div>
    </body>
</html>
=================================================
网页邮件顾名思义发送的就是网页格式的邮件,只要在发送时声明类型即可成功发送,shell、python、Foxmail都可发送,另外在测试中发现QQ邮箱可以在线预览编辑html邮件。

网页基本结构 (有些可以省略)
<html>
     <head>
          <title></title> 是网页的标题
          <link/> 引用外部css/js
          <meta /> 语言  一般是utf-8/gb2312
     </head> 是网页头信息,一般来告诉浏览器引用的css/js样式是从哪里拿,还有语言、html版本等信息
     <body>    
     </body> 是网页的主体结构用来书写网页的主要部分
     <script></script> js函数或者引用一个什么东西进来 位置随意。一般是实现页面动态特效和辅助数据的元素
</html> 是网页的大结构,主要是告诉浏览器这个标签对是写的html的相关东西 用来区分

块级元素:容量比较大的标签,一般自带换行的标签都是块面级,且块面之间可以相互嵌套。 <div>、<table>、<p>、<br/>、<ul>
行内元素:只支持一行,不支持嵌套。<a>、<soqn>、<b>

样式:给标签赋予特定的颜色、大小、形状。是样式的作用。
     样式有多种方法调用 行内调用是效力最强的 如给一个特定的<a>标签赋予颜色和字体大小的设置需要在行内写style:
          <a href="#" style="color: read font-size:16px" >HTML基础</a>
    如果有比较批量的<a>标签需要改变样式则给标签一个标记利用 class、id、name实现
     <a href="#" class="baise">这是class样式演示</a>    <a href="#" id="fense">这是id样式演示</a>   <a href="#" name="wuse" >这是name演示的演示</a>   
     .baise{ color: #FFFFFF}                              #fense{color: #FF1493}                               无法建立样式
    
     若要全部<a> 标签生效
     a{color: blue}
    
===================================================
注:网页邮件有很多样式限定,对于div的兼容性比较差,尽量使用table进行嵌套部署。
   可以从bootstrap寻找样式提取取来加载进<style></style>中 然后在下文使用class或者id进行调用。

    
要使邮件报警跟脚本的输出结合起来我是用拼接实现的,将html table前面的部分保存成文件加载进脚本。
脚本输入的东西进行处理成网页table需要的格式跟加载的前半部分拼接而成,最后的结尾再做个拼接成品即可发送。

somkeping邮件美化

#!/bin/bash

DATE=`date -d "-1 min" +%Y%m%d-%H%M`
active="off"
DATE_s=`date -d "-1 min" +%Y%m%d-%H%M`
MAILLOG=/usr/local/smokeping/var/alert_logs/alertmail.$DATE ##日志中获取
MAILLIST="@@@@@@@.#@@com"
num=$((`cat $MAILLOG |egrep -v "#|$(date +%Y)*|someloss|lossdetect|^$"|wc -l`/4))
>/home/3jia5om/scripts/html_tmp
htmla=`echo -e ‘<html><meta  http-equiv="Content-Type" content="text/html; charset=UTF-8"><body><style>table{border-collapse:collapse;border-spacing:0;background-color:transparent}.table{width:90%;max-width:95%;margin-bottom:20px}.table>tbody>tr>td{padding:6px 4px;line-height:1.42857143;vertical-align:top;border-top:1px solid #dddddd;text-align:center;font-size:11px;width:40px}.table-condensed>tbody>tr>td{padding:5px}.table-bordered{border:1px solid #dddddd}.table-bordered>tbody>tr>td{border:1px solid #dddddd}.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd){background-color:#f9f9f9}.table>tbody>tr.active>td{background-color:#f5f5f5}.table>tbody>tr.warning>td{background-color:#fcf8e3}.table>tbody>tr.info>td{background-color:#d9edf7}.table>tbody>tr.danger>td{background-color:#f2dede}.table>tbody>tr.success>td{background-color:#dff0d8}.panel{margin-bottom:20px;background-color:#ffffff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05);width:760px}.panel-heading{border-bottom:1px solid transparent;border-top-right-radius:3px;border-top-left-radius:3px}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-info{border-color:#bce8f1;}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}span{margin-right:20px}ul li{list-style:none;float:left;line-height:34px}.me{margin-left:13%}.gaodu{height:30px}.zuo{text-align:left;margin-left:10px}</style>‘`
if [ -f $MAILLOG ];then
s_add=(`cat $MAILLOG |grep CDN|awk -F "[][]" ‘{print $1,$2}‘|awk  ‘{print $3}‘`) ##切出来自IP
d_add=(`cat $MAILLOG |grep CDN|awk -F "[][]" ‘{print $1,$2}‘|awk  ‘{print $1}‘`) ##切出来自名称
else
     exit 0
fi
if [ -f $MAILLOG ];then
    countnum=0
##循环主体
    for i in `seq 1 $num`
    do
     on=‘on‘
        content=`cat $MAILLOG |egrep -v "#|$(date +%Y)*|someloss|lossdetect|^$"|sed -n $[($i-1)*4+1],$[$i*4+1]p`
"***.***.**.***|***.***.**.***|***.***.**.***|***.***.**.***|***.***.**.***|***.***.**.***|***.***.**.***"`
        head=`echo $content|sed -n 1p`
        lost=`cat $MAILLOG |egrep -v "#|$(date +%Y)*|someloss|lossdetect|^$"|sed -n $[($i-1)*4+1],$[$i*4+1]p|sed -n 2p|awk -F ":" ‘{print $2}‘|sed ‘s/[[:space:]]//g‘`
        rtt=`cat $MAILLOG |egrep -v "#|$(date +%Y)*|someloss|lossdetect|^$"|sed -n $[($i-1)*4+1],$[$i*4+1]p|sed -n 3p|awk -F ":" ‘{print $2}‘|sed ‘s/[[:space:]]//g‘`
        to=` cat $MAILLOG |egrep -v "#|$(date +%Y)*|someloss|lossdetect|^$"|sed -n $[($i-1)*4+1],$[$i*4+1]p|sed -n 4p`
        add=`echo $head|awk -F "[][]" ‘{print $1,$2}‘|awk ‘{print $3}‘`
        #echo $add|wc -L
        if [ `echo $add|wc -L` -lt 7 ];then
            add="***.***.**.***"
        fi
        hostname=`echo $head|awk ‘{print $1}‘|awk -F "." ‘{print $NF}‘`
        ushote=`echo $head|awk -F "[][]" ‘{print $1,$2}‘|awk -F "." ‘{print $1}‘`
        count=0
     counts=0
     for line in `cat /home/3jia5om/scripts/black.somkeping`
     do
            count=$[$count+1]
         if [ $[$count%2] -eq 1 ];then
             blackname=$line
          #echo $blackname
         else
          blackip=$line
         fi
         if [ $count -ge 2 ];then
            if [[ $hostname == $blackname ]];then
             blackip=${blackip//,/ }
          for ip in $blackip
          do
              #echo $ip
              if [[ $add == $ip ]];then
               active="on"
               counts=$[$counts+1]
               #echo "状态激活"
               echo "`date +%Y‘-‘%m‘-‘%d‘ ‘%H‘:‘%M‘:‘%S` 报警节点:$blackname 来自IP:$ip 被手动屏蔽。" >>/home/3jia5om/scripts/alert.log
              fi
          done
          fi
             count=0
         fi
     done
     #echo $active
     if [[ $active == $on ]];then
            #echo "1111"
         active="off"
            continue
        fi
        echo ‘<div class="panel panel-info" style="width: 820px"><div class="panel-heading" style="height: 35px">‘>>/home/3jia5om/scripts/html_tmp
        echo "<ul class="panel-title"><li>报警节点:</li><li><span>$hostname</span></li><li  class="me">所属线路:</li><li><span>$ushote</span></li><li class="me">来自IP:</li><li><span>$add</span></li></ul></div>">>/home/3jia5om/scripts/html_tmp
        echo ‘<div class="panel-body"><table class="table table-bordered"style="margin:10px 1%"><tbody><tr class="info gaodu">‘>>/home/3jia5om/scripts/html_tmp
        echo -e "<td>Loss:</td><td>$(echo $lost|awk -F "," ‘{print $1}‘)</td><td>$(echo $lost|awk -F "," ‘{print $2}‘)</td><td>$(echo $lost|awk -F "," ‘{print $4}‘)</td><td>$(echo $lost|awk -F "," ‘{print $5}‘)</td><td>$(echo $lost|awk -F "," ‘{print $6}‘)</td><td>$(echo $lost|awk -F "," ‘{print $7}‘)</td><td>$(echo $lost|awk -F "," ‘{print $8}‘)</td><td>$(echo $lost|awk -F "," ‘{print $9}‘)</td><td>$(echo $lost|awk -F "," ‘{print $10}‘)</td><td>$(echo $lost|awk -F "," ‘{print $11}‘)</td><td>$(echo $lost|awk -F "," ‘{print $12}‘)</td><td>$(echo $lost|awk -F "," ‘{print $13}‘)</td><td>$(echo $lost|awk -F "," ‘{print $14}‘)</td><td>$(echo $lost|awk -F "," ‘{print $15}‘)</td><td>$(echo $lost|awk -F "," ‘{print $16}‘)</td><td>$(echo $lost|awk -F "," ‘{print $17}‘)</td><td>$(echo $lost|awk -F "," ‘{print $18}‘)</td><td>$(echo $lost|awk -F "," ‘{print $19}‘)</td></tr> <tr class="gaodu"><td>Rtt:</td><td>$(echo $rtt|awk -F "," ‘{print $1}‘)</td><td>$(echo $rtt|awk -F "," ‘{print $2}‘)</td><td>$(echo $rtt|awk -F "," ‘{print $4}‘)</td><td>$(echo $rtt|awk -F "," ‘{print $5}‘)</td><td>$(echo $rtt|awk -F "," ‘{print $6}‘)</td><td>$(echo $rtt|awk -F "," ‘{print $7}‘)</td><td>$(echo $rtt|awk -F "," ‘{print $8}‘)</td><td>$(echo $rtt|awk -F "," ‘{print $9}‘)</td><td>$(echo $rtt|awk -F "," ‘{print $10}‘)</td><td>$(echo $rtt|awk -F "," ‘{print $11}‘)</td><td>$(echo $rtt|awk -F "," ‘{print $12}‘)</td><td>$(echo $rtt|awk -F "," ‘{print $13}‘)</td><td>$(echo $rtt|awk -F "," ‘{print $14}‘)</td><td>$(echo $rtt|awk -F "," ‘{print $15}‘)</td><td>$(echo $rtt|awk -F "," ‘{print $16}‘)</td><td>$(echo $rtt|awk -F "," ‘{print $17}‘)</td><td>$(echo $rtt|awk -F "," ‘{print $18}‘)</td><td>$(echo $rtt|awk -F "," ‘{print $19}‘)</td></tr><tr style="height: 30px"><td colspan="2">目标IP:</td><td class="zuo"  colspan="18">$to</td></tr></tbody></table></div></div>">>/home/3jia5om/scripts/html_tmp
        countnum=$(($countnum+1))
    done
    htmlb=`cat /home/3jia5om/scripts/html_tmp`
    htmlc="</body></html>"
    htmla=$htmla$htmlb$htmlc
    if [ $countnum -gt 0 ];then
         #echo $htmla
        echo $htmla| mail -s "$(echo -e "[SmokeAlert] is active on $DATE $MAILLIST \nContent-Type:text/html;charset=utf-8")" -r "somkeping" $MAILLIST
        dsg="`echo $2 $4`"
        #/usr/bin/curl -d "group=IDCswitch&subject=\"IDC network quality smokeping alert\"&msg=$Msg" http://*.*.*.*/msgserver/sendinfo.jsp >/dev/null 2>&1
        #这里是短信接口
    fi
else
    echo ok
fi

不报警 分组&节点

技术分享

技术分享

20161129-0200
someloss
CDN_Chinanet.CDN_BJ.bj163 [from ***.***.***.***]
loss: 57%, 27%, 37%, 36%, 37%, 27%, 36%, 34%, 32%, 38%, 29%, 29%, 37%, 27%, 36%, 22%, 20%, 23%, 17%
rtt: 139ms, 135ms, 135ms, 135ms, 135ms, 135ms, 135ms, 135ms, 135ms, 135ms, 135ms, 134ms, 135ms, 134ms, 135ms, 134ms, 134ms, 134ms, 117ms

***.***.***.***
#############################################################

someloss
CDN_Chinanet.CDN_BJ.bj163 [from ***.***.***.***]
loss: 11%, 7%, 7%, 7%, 13%, 5%, 9%, 6%, 7%, 3%, 6%, 6%, 7%, 7%, 7%, 4%, 5%, 2%, 3%
rtt: 139ms, 139ms, 139ms, 139ms, 139ms, 139ms, 139ms, 139ms, 139ms, 139ms, 139ms, 139ms, 139ms, 139ms, 139ms, 139ms, 139ms, 139ms, 139ms
***.***.***.***


源文件

分组检查邮件报警

#!/bin/bash
base_dir=/home/3jia5om/scripts/check_group_number
work_dir=/root/powercdn_dns_conf
group_dir=$work_dir/group
WHITE_GROUP=$base_dir/white_group  #特殊分组(白名单)
SPECIAL_GROUP=$base_dir/no_use_group #无用分组
error_group=$base_dir/error_list
html1=$base_dir/html1
html4="</tbody></table></div></div></body></html>"
>$base_dir/html2
>$error_group
for i in $group_dir/*.group      
do
     GROUP=`echo ${i##*/} | awk -F\. ‘{print $1}‘` 
     count=`egrep -o ‘[0-9]{1,3}(\.[0-9]{1,3}){3}‘ $i |wc -l`  
     if [ $count -lt 5 ]   
     then       
          grep $GROUP $WHITE_GROUP |grep -v special_bj |grep -v special_bj_udp|grep -v download|grep -v meibeian |grep -v g12851373 >> /dev/null
          if [ $? -eq 0 ]   
          then
               echo "$GROUP special  node is  $count " >> $error_group  
          fi
     elif [ $count -lt 10 ] 
     then
          grep $GROUP $WHITE_GROUP >> /dev/null || grep $GROUP $SPECIAL_GROUP >> /dev/null  
          if [ $? -ne 0 ] 
          then     
               echo "$GROUP normal node is  $count  " >> $error_group 
          fi
     fi
done
if [ -s $error_group ];then 
     D=`date +"%F %T"`   
     info="$D `sort -t ‘ ‘ -k 3 -k 5  $error_group | column -t`"
     sendsms() {
           for call in 18610297949 18613879049
            do
                    curl --data "p=$call&c=$info" "http://smss.powercdn.com/sendmsg/sendmsg.html"
            done 
     cat $base_dir/error_list |while read i  ##循环有问题的分组
     do
          echo -e "<tr class="warning" style="height: 30px"><td style="width: 140px"><span class="fenzu">`echo $i|awk ‘{print $1}‘`</span></td> \n <td style="width: 50px"><span class="num">`echo $i|awk ‘{print $5}‘`</span></td></tr>" >>$base_dir/html2 ##输出网页表格结构
     done
     html2=$base_dir/html2
     html3=`cat $html1 $html2`
     echo "$html3 $html4"|mail -s "$(echo -e "check node number\nContent-Type:text/html;charset=utf-8")" -r "grouplist_node_check" [email protected] [email protected]
     #echo "${info}"|mail -s "check node number" -r "check node"  @@@[email protected]@.com 
     }
     sendsms
else
     exit
fi


技术分享


本文出自 “12193705” 博客,谢绝转载!

以上是关于请问谁有发送邮件的那个网页 HTML 源代码的主要内容,如果未能解决你的问题,请参考以下文章

python - 发送邮件(email模块(内置))

php发送邮件

Python 3.8发送邮件

如果在php网页加邮件发送代码

在html中啥不能在网页上通过链接直接打开客户端的发送邮件

什么是“HTML格式发送邮件”?