zoukankan      html  css  js  c++  java
  • generate eml file

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
     <HEAD>
      <TITLE> Send Email </TITLE>
      <META NAME="Generator" CONTENT="EditPlus">
      <META NAME="Author" CONTENT="">
      <META NAME="Keywords" CONTENT="">
      <META NAME="Description" CONTENT="">
     </HEAD>
    
    
    <textarea id="textbox" style=" 300px; height: 600px;">
    To: sample <sample@hotmail.com>
    Subject: Invoice
    X-Unsent: 1
    Content-Type: text/html
    
    <html>
    <head>
    <style>
        body, html, table {
            font-family: Calibri, Arial, sans-serif;
        }
        .pastdue { color: crimson; }
        table {
            border: 1px solid silver;
            padding: 6px;
        }
        thead {
            text-align: center;
            font-size: 1.2em;
            color: navy;
            background-color: silver;
            font-weight: bold;
        }
        tbody td {
            text-align: center;
        }
    </style>
    </head>
    <body>
    <table width=100%>
        <tr>
            <td><img src="http://192.168.255.221/logo.png" width="200" height="57" alt=""></td>
            <td align="right"><h1><span class="pastdue"></span> INVOICE</h1></td>
        </tr>
    </table>
    <table width=100%>
        <thead>
            <th>Invoice #</th>
            <th>Days Overdue</th>
            <th>Amount Owed</th>
        </thead>
        <tbody>
        <tr>
            <td>OU812</td>
            <td>9</td>
            <td>$4395.00</td>
        </tr>
        <tr>
            <td>OU812</td>
            <td>9</td>
            <td>$4395.00</td>
        </tr>
        <tr>
            <td>OU812</td>
            <td>9</td>
            <td>$4395.00</td>
        </tr>
        </tbody>
    </table>
    </body>
    </html>
    
    </textarea> 
    <br>
    
    <button id="create">Create file</button><br><br>
    <a download="invoice.eml" id="downloadlink" style="display: none">Download</a>
    
       
     <script>
        (function () {
            var textFile = null,
              makeTextFile = function (text) {
                var data = new Blob([text], {type: 'text/plain'});
                if (textFile !== null) {
                  window.URL.revokeObjectURL(textFile);
                }
                textFile = window.URL.createObjectURL(data);
                return textFile;
              };
    
              var create = document.getElementById('create'),
                textbox = document.getElementById('textbox');
                create.addEventListener('click', function () {
                
                
                var link = document.getElementById('downloadlink');
                link.href = makeTextFile(textbox.value);
                link.style.display = 'block';
                
            }, false);
        })();
     </script>
     </BODY>
    </HTML>
  • 相关阅读:
    [HNOI2002]营业额统计
    HDU 1374
    HDU 3345
    HDU 2089
    Graham扫描法
    Codeforces 1144D Deduction Queries 并查集
    Codeforces 916E Jamie and Tree 线段树
    Codeforces 1167F Scalar Queries 树状数组
    Codeforces 1167E Range Deleting
    Codeforces 749E Inversions After Shuffle 树状数组 + 数学期望
  • 原文地址:https://www.cnblogs.com/coolyylu/p/9591665.html
Copyright © 2011-2022 走看看