我試圖轉換一些.Net網站中使用的Python代碼。該代碼檢索存儲在RFC822格式的消息,並將該消息再次使用SMTP服務器: mail from: blah blah
rcpt to: blah blah
data
<send the text from the RFC822 file here>
.
所以沒有RFC822文件的解析是必需的(幸運的!)。在Python這簡直是: sm
我想使用PHP腳本將以下電子郵件轉換爲txt文件。即時通訊使用管道郵件功能,但運行腳本時得到亂碼。 #!/usr/bin/php -q
<?
/* Read the message from STDIN */
$fd = fopen("php://stdin", "r");
$email = ""; // This will be the variable holding the data