简体   繁体   English

PHP - TurboSMTP API 发送带附件的电子邮件

[英]PHP - TurboSMTP API send email with attachment

I was wondering if it is possible to send amail with (.pdf) attacchment with the TurboSMTP API ( http://serversmtp.com/it/servizio-smtp-api ).我想知道是否可以使用 TurboSMTP API ( http://serversmtp.com/it/servizio-smtp-api ) 发送带有 (.pdf) 附件的邮件。 I've noticed that in those API there is no method to add an attachment, maybe I've searched wrong.我注意到在那些 API 中没有添加附件的方法,也许我搜索错了。

EDIT: as mark suggested me, I've contacted the provider, and they said that the service does not allow actually to send email with attachment, and in less than a month they're gonna implement that.编辑:正如马克建议我的那样,我已经联系了提供商,他们说该服务实际上不允许发送带有附件的电子邮件,并且在不到一个月的时间内他们将实施该服务。

Please, someone mark as closed this topic.请有人将此主题标记为已关闭。

Thanks for help btw.谢谢你的帮助顺便说一句。

Actually, there is currently a way to attach file, but you have to build a whole MIME body and pass it using the mime_raw post parameter, that overrides content and html_content .实际上,目前有一种附加文件的方法,但您必须构建一个完整的 MIME 正文并使用mime_raw post 参数传递它,该参数覆盖 content 和html_content

To build a valid MIME body you could inspect what PHPMailer does when you attach a file, the body is built when you call its preSend() method.要构建一个有效的 MIME 主体,您可以检查PHPMailer在附加文件时所做的事情,主体是在调用preSend()方法时构建的。

Unluckily, I've recently discovered that a MIME body over 150,000 bytes does not get sent.不幸的是,我最近发现超过 150,000 字节的 MIME 正文没有被发送。 I've opened a ticket with the provider.我已经与提供商开了一张票。

我收到了来自 TurboSMTP 支持的电子邮件,它刚刚添加了支持发送带附件的邮件https://www.serversmtp.com/turbo-api/#send-email-2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM