简体   繁体   English

如何使用PHP发送带有附件的gpg加密电子邮件?

[英]How to send gpg-encrypted emails with attachments using PHP?

I am looking for an easy way in PHP to send GPG encrypted emails with attachments. 我正在寻找一种在PHP中发送带有附件的GPG加密电子邮件的简便方法。

I understand the individual pieces on how to send emails, how to use gpg command line and how MIME works. 我了解有关如何发送电子邮件,如何使用gpg命令行以及MIME如何工作的各个部分。 But I am interested in existing libraries. 但是我对现有的库感兴趣。 So that I don't re-invent the wheel on a low level. 这样我就不会在低层次上重新发明轮子了。

The encrypted emails will be reading using Thunderbird with Enigmail. 加密的电子邮件将与Thunderbird和Enigmail一起使用。

There's a GnuPG extension , failing that you're best off using exec() and friends to invoke the regular gpg binaries. 有一个GnuPG扩展名 ,如果您最好不要使用exec()和朋友来调用常规gpg二进制文件, 则为扩展名 There's a decent Zend article showing hints for the latter approach Zend上有一篇不错的文章 ,介绍了后一种方法的提示

There is ongoing work at PEAR to accomplish this; PEAR正在为此进行工作; see https://pear.php.net/bugs/bug.php?id=20938 参见https://pear.php.net/bugs/bug.php?id=20938

You may try php-gpg from https://github.com/jasonhinkle/php-gpg 您可以从https://github.com/jasonhinkle/php-gpg尝试php-gpg

It supports the encryption using a public key. 它支持使用公共密钥的加密。

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

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