如何将具有文本和超链接的.rtf文件转换为html邮件

时间:2019-07-19 05:54:51

标签: applescript-excel

我正在脚本编辑器中编写脚本,以使用MyMail应用程序发送电子邮件。我正在取货。 .rtf文件中的电子邮件正文,该文件包含文本和超链接。撰写和发送电子邮件时会显示html标签。我该如何转换。下面是脚本和结果

set EmailBody to do shell script "/usr/bin/textutil " & " -stdout -format rtf -convert html -encoding UTF-8 " & quoted form of POSIX path of rtfEmailBody

预期的输出是仅包含超链接和文本的邮件正文,但是我得到的输出类似

"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta name="generator" content=
"HTML Tidy for Mac OS X (vers 31 October 2006 - Apple Inc. build 16.1), see www.w3.org">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="1671.5">
<style type="text/css">
    p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
    p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
</style>
</head>
<body>
<p class="p1">Dear &lt;First_Name&gt;</p>
<p class="p2"><br></p>
<p class="p1">I am personally writing to ask you to attend and
participate in our upcoming Independent Charter School Symposium in
Old Town, Albuquerque from <b>November 17-20</b></p>
<p class="p2"><br></p>
<p class="p1">This is going to be an educational <a href=
"http://google.com">conference</a> that you will not want to
miss.<span class="Apple-converted-space"> </span></p>
<p class="p1">Please come. We need your voice.<span class=
"Apple-converted-space"> </span></p>
<p class="p2"><br></p>
<p class="p1">Sincerely,</p>
</body>
</html>```

0 个答案:

没有答案