是否可以通过SMTP将超过25MB的文件附加到传出的Gmail邮件中?
Gmail允许普通浏览器用户通过允许他们首先将文件上传到Google Drive然后发送,来“附加”大于25MB的文件。是否可以通过SMTP将超过25MB的文件附加到传出的Gmail邮件中?
这是通过gmail用户界面无缝完成的,只需一个额外的点击用户通知他们它将被上传到Google驱动器并作为链接而不是常规文件附件发送。
有没有办法让一个付费的gsuite gmail账户在通过SMTP连接超过25MB大小的文件时自动执行这个操作?
或者我需要像他们一样完成吗?通过Google Drive API上传,然后通过电子邮件发送到谷歌驱动器下载链接?
在浏览器窗口中通过GMail用户界面访问的免费Gsuite帐户会自动将大型附件添加到驱动器并显示“您的文件大于25 MB,它将作为Google Drive链接发送。”。所以,在浏览器窗口中通过GMail用户界面访问的付费Gsuite帐户似乎也会这样做(但我无法测试此功能,因此缺少付费帐户)。
但是,这项服务是GMail在线电子邮件客户端的一部分。您显然正在使用一个不同的(非指定的,可能是离线的)电子邮件客户端,并且可能还有一个或多个SMTP服务器与Google SMTP服务器之间。
为了得到您想要的,您需要客户端或smtp服务器来识别文件附件大于设定大小,然后自动将文件上传到驱动器并插入驱动器链接。
可能可以发现,有谷歌驱动器集成到这个程度电子邮件客户端,Everdesk http://www.everdesk.com/features#google_support和EMClient http://www.emclient.com/features都声称谷歌的整合,但我没有调查他们是否自动上传大附件,如在线的Gmail界面。
在这种情况下,Zapier,Sendtodocs和IFTTT等在线服务将无法正常工作,因为他们依赖于向他们获取内容,显然,大型附件会被Google SMTP服务器阻止。
好问题。我做了一个测试,并给自己发送了这样一个附件,然后在gmail中做了“查看原文”。这就是它说
Date: Thu, 2 Mar 2017 08:36:40 +0000
Subject: gmail drive test
To: Todo <[email protected]>
Content-Type: multipart/alternative; boundary=001a114a970436d05b0549bb55bd
--001a114a970436d05b0549bb55bd
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
=E2=80=8B
Untitled spreadsheet
<https://docs.google.com/spreadsheets/d/149LLw1nY24vlYx_d=
sWn4QWwnM/edit?usp=3Ddrive_web>
=E2=80=8B
--001a114a970436d05b0549bb55bd
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">=E2=80=8B<br><div class=3D"gmail_chip gmail_drive_chip" st=
yle=3D"width:396px;height:18px;max-height:18px;background-color:#f5f5f5;pad=
ding:5px;color:#222;font-family:arial;font-style:normal;font-weight:bold;fo=
nt-size:13px;border:1px solid #ddd;line-height:1"><a href=3D"https://docs.g=
oogle.com/spreadsheets/d/149LLw1nY24vlYx_dsig/edit?=
usp=3Ddrive_web" target=3D"_blank" style=3D"display:inline-block;overflow:h=
idden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none;paddin=
g:1px 0px;border:none;width:100%"><img style=3D"vertical-align: bottom; bor=
der: none;" src=3D"https://ssl.gstatic.com/docs/doclist/images/icon_11_spre=
adsheet_list.png">=C2=A0<span dir=3D"ltr" style=3D"color:#15c;text-decorati=
on:none;vertical-align:bottom">Untitled spreadsheet</span></a></div>=E2=80=
=8B<br></div>
--001a114a970436d05b0549bb55bd--
所以看起来你需要的是在一个单独的MIME部分,并用它自动将Gmail网络客户交易的网络链接。