邮件群发带图片附件

今天有时间简单记录一下以前群发邮件的工作(带附件)
一般发送邮件都是发送html的字符串或html文件的
在这里分享一个小技巧,发送带图片的邮件的时候,有的时候图片在网络上某个url下
可以将图片转成BASE64编码的一堆字符串,然后img标签的src这么写
图片转base64
图片转base64
<img src="…’’>
双引号直接粘贴上面两个链接转的内容,举
例:

<img src="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wAARCAAZABgDAREAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAABgcIAQX/xAAqEAACAgIBAwQBAwUAAAAAAAABAgMEBQYHABESCBMhIhUUFlExN0F1sv/EABsBAAEFAQEAAAAAAAAAAAAAAAYAAwQFBwEC/8QAMhEAAQIFAgQEAgsAAAAAAAAAAQIRAAMEBSESMQZBUWETcZGhIvAHFRYyM3KBwdHh8f/aAAwDAQACEQMRAD8Asfmr1C7J++LXHHFtWhNslKGObObHlkaSjhFkAMcYiUgz2XTu4j8lVR4sx+QOhi+8QU1ilBc34lq2SNz37Dv6AxZ0Nvm1yyEYA3MLyPBcyQT/AK5Ofc5Lkf6mOxgcY1En+PYWFSF7fxIG/wA+Xf56y4fSLV63MhOno5f1/qCg8OydOJhf9Pn3ho8FeofNbHuM/HXI2MpYfeY6zXsfexbN+OzlVCA8sAclopELL5wsWIBDBmU/GsWW9018p/Gp8EYUDuD/AB0PP2gUraKbQzNEznsesS/pdije4tyN7P3MvSye079k1ycWF91blu22UnhjqgxdpIwVhhT6kEKvbuAeslvsusruJZsmnQFrSkaQpmA0guysFiSz8/KCyhVJkW1K5iikEl2d9yOWeQjo1to1zIaTj8Gbu+WsKbQlWUV7q2bEEiRzRVmsgiYoFuVD5efkylFYkMw6j/Zi+CealNMgKIbdDA4dQT91znkwJcZaHfrOh0CWZqmfu7dH3jfyNWGDg7M4LI5PJ2qHIsGLq2ssXW6IpLdinbryGT7v4RGVCW7swhDEk/PVjwwmqo+IptPOQEKKPiCWbZJfGA5zjAcgRGuZlTrcmYhRIfBO+5xnP+QX+obhnKcc7JtmVr4LIbJxdtl1MzfjwlY2b+uZVSjPcWuAWmgd40lYKGKuH7oVY9HN8s1RNqpV1tpAny+R2UOnnkjyO4YRR0NbLRKVSVP4aufQ9YmSnl+L4MRXxY3HST7TRxpfqx2Zco/t1qNdVGNKFhKWos5BdvtOw8Oy/Pg366KT4aLcvxe5Gh/zdPl46KClB1KqBp9/SKv9NPCGT2natU2zL69kNS0PToZDq+DzI8MhfuyqySZG3EfmLsjyBEb7lpXdgvwOpFgss6hXNrq5QVUTd22A6D9/IAbOW6+tRPSiRIDS0bd+8WT0ZxTQE0v7uX/9YP8AtOlCg26UKP/Z">

src=“data:image/jpeg;base64,/9j//gAOTGF2YzU0LjI…”
温馨提示 图片超过300kb就不要用这种方法了,刚刚我的notpad++崩溃了两次
发送带附件的邮件我就不写了,网上一大堆,这次主要是记录一下这个小技巧
ps:给大家推荐两部电影,一部特搞笑,一部特感动
世界末日 美姐

©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页