小编roz*_*kin的帖子

使用Mail.app从Cocoa发送HTML Mail

我正试图通过Mail.app从Cocoa应用程序发送html电子邮件.我想在Mail.app中打开新邮件,包括主题,收件人,并添加带有链接和其他内容的HTML Body.但找不到这样做的方法.我已经尝试过Scripting Bridge,但MailOutgoingMessage类没有内容类型我可以用纯文本添加内容.

尝试过AppleScript,如下所示:

set htmlContent to read "/Path/index.html"
set recipientList to {"mail@mail.com"}

tell application "Mail"
    set newMessage to make new outgoing message with properties {subject:"qwerty", visible:true}
    tell newMessage
        make new to recipient at end of to recipients with properties {address:"mail@s.com"}
            set html content to htmlContent
        --send
    end tell
end tell
Run Code Online (Sandbox Code Playgroud)

这段代码发送电子邮件与html,只有我正在改变 - 发送.但是我需要在用户做出一些更改之后发送信件.

applescript objective-c scripting-bridge

7
推荐指数
2
解决办法
2209
查看次数

iframe src设置了大的base64数据

我有用于PDF预览的iframe和大量的base64数据(超过10mb).

<iframe src="" type="application/pdf"></iframe>'
Run Code Online (Sandbox Code Playgroud)

我该如何使用这些数据?当我尝试设置数据时:

$("iframe").attr("src", data);
Run Code Online (Sandbox Code Playgroud)

有些浏览器崩溃了.

我没有src链接.这个数据由ajax收到.有什么建议?

javascript iframe base64 src

5
推荐指数
2
解决办法
3万
查看次数