2015-06-22 230 views
-1

我想在郵件正文中添加PDF,而不是使用AddInlineStringAttachment(),但在正文中。目標是在沒有下載的情況下查看pdf。 謝謝在郵件中添加PDF使用PHPMailer的郵件正文

+0

爲此,您必須在您的電子郵件中嵌入PDF查看器,這似乎不可行。所以你最好的選擇是將PDF轉換成圖像或HTML。 – Keval

回答

0

所以,你可以做的是將PDF嵌入到你的電子郵件的html部分,你可以通過幾種方式來實現。

1 - 使用<object>標籤:

<object width="400" height="400" type="application/pdf" data="http://emersonjair.info/files/rf-pibic-2013-Emerson.pdf"></object> 

2 - 使用標籤:

<iframe src="http://emersonjair.info/files/rf-pibic-2013-Emerson.pdf"></iframe> 

3 - 使用<embed>標籤:

<embed type="application/pdf" src="http://emersonjair.info/files/rf-pibic-2013-Emerson.pdf"> 

4 - 使用PDF.js:

PDF.js Github page

5 - 使用pdf2htmlEX

pdf2htmlEX Github page

6 - 這是一個類似的問題:

Recommended way to embed PDF in HTML?

PS:用戶要下載的PDF文件,無論如何,即使如果他以後不保存它。