Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
287 views
in Technique[技术] by (71.8m points)

javascript - add default signature to emlContent

I use code that creates an "eml" file, I try to add to email the default signature of Outlook and can not find a way to do that. this is my code:

        var htmlDocument = "<p style="text-align: right; direction: rtl; unicode-bidi: embed;">????, <br />"+
        "   ????? ?????? ????? ?????  ?? ??? ???? ???????? , ?????? ????? ???? ??? ???? ?????  ????? ????? ????? ????? , ??? ?????.<br />"+
        "???? ???? ???? ????? ???????? ????? ????? , ??? ???? ???? ???? ?????? ????? ?????? ?????. <br />"+
"???? ??????  ??? ?????? 036579500 ????? 3 ?? ????? ???? ?? ?????  ?????? ?????? ???  , ????? ???? ?????.<br />"+
 "</p>"
            
        var emlContent = "data:message/rfc822 eml;charset=windows-1255," + "
";
            emlContent += "To: "+mailsend + "
";
            emlContent += "Subject: ????? ???? "+terminal+" ???? ????  " + "
";
            emlContent += "X-Unsent: 1" + "
";
            emlContent += "Content-Type: text/html" + "

";
            emlContent += htmlDocument;
        
        emlContent= windows1255.encode(emlContent);
        var uint8 = new Uint8Array(emlContent.length);
        for (var i = 0; i < uint8.length; i++)
                    {
                        uint8[i] = emlContent.charCodeAt(i);
                    }
        
        var file = new Blob([uint8], {type: 'text/plain;charset=windows-1255'}); 
        var a = document.createElement("a"),
        url = URL.createObjectURL(file);
        a.href = url;
        a.download = "???? ???? ?????? - " + user + ".eml";
        document.body.appendChild(a);
        a.click();
        setTimeout(function() {
            document.body.removeChild(a);
            window.URL.revokeObjectURL(url);  
        }, 0); 

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...