2015-10-23 48 views
0

嘗試注意。在nodemailer採用DPD-電子郵件(其使用nodemailer) 通過實例文件(https://github.com/andris9/Nodemailer#attachmentsdpd-email/nodemailer不需要修改文件

這只是給我的「依戀1.bin」文件大小0KB

使用來自不同勢後例子嘗試nodemailer站點,但結果相同。

使用鉻郵遞員

 http://localhost:99/email 
     to:"[email protected]" 
     subject: "test" 
     text: "test" 
     attachments: [ 
    {filename: "test.tx"', content:"hello world", contentType:"text/plain"} 

] 

enter image description here

回答

0

在NodeMailer,attachmentsattachment對象的數組。在上面的代碼片段中,您將attachments設置爲對象而不是數組。

直接從E-mail Message Fields

附件摘自 - 附接的對象數組

變化

attachments: { 
    filename: 'text.bin', 
    content: 'hello world!', 
    contentType: 'text/plain' 
} 

attachments: [ 
    { 
    filename: 'text.bin', 
    content: 'hello world!', 
    contentType: 'text/plain' 
    } 
] 
+0

附件:[{文件名: 「test.tx」」,內容: 「世界你好」,則contentType: 「text/plain的」}] –

+0

依然只是讓我依戀1.bin –