mailto body html,email - mailto link with HTML body - Stack Overflow

It's not quite what you want, but it's possible using modern javascript to create an EML file on the client and stream that to the user's file system, which should open a rich email containing HTML in their mail program, such as Outlook:

Here's a jsfiddle of an email containing images and tables: https://jsfiddle.net/seanodotcom/yd1n8Lfh/

HTML

To: User

Subject: Subject

X-Unsent: 1

Content-Type: text/html

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;

}

PAST DUE INVOICE

Invoice #Days OverdueAmount Owed

OU8129$4395.00OU8129$4395.00OU8129$4395.00

Create file

Download

Javascript

(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);

})();

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值