2014-06-13 96 views
1

我正在嘗試使用jQuery發送電子郵件。這裏是我的代碼在jquery中使用自定義預定義電子郵件文本打開電子郵件客戶端

$text = "mailto:[email protected]?subject=The Vow Engagement Ring Finder&body=" . "Hi, I found an engagement ring that I love and want to know what you think. To see the ring download the iPhone app named <The Vow Engagement Ring Finder> iPhone - http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=509902433&mt=8 - Android - https://play.google.com/store/apps/details?id=com.diadori.thevow. View the ring: ". $rings[0]['ringThumbNailImagePath'] . "</html>"; 

    $bodytag = str_replace(" ", "%20", $text); 

jQuery中

window.location.herf = $bodytag; 

它工作正常,但文本僅顯示高達ID = 509902433,因爲它&停在那裏。我已經嘗試放置HTML標籤,但沒有工作。

如何自定義在mailto中放置郵件。 其次有沒有什麼方法可以添加附件?

+0

@pmandell我需要打開電子郵件客戶端 –

回答

0

百分比編碼是:

... ects/MZStore.woa/wa/viewSoftware?id=509902433%26mt=8 - Androi ... 

不是:

... ects/MZStore.woa/wa/viewSoftware?id=509902433&mt=8 - Androi ... 

所以:

請參閱本相關主題:escaping ampersand in url

+0

媽,爲什麼它不會發生在我身上 - 「 - 。我如何添加附件,並知道「輸入」的ASCII碼 –

+0

您是否試圖將附件添加到來自用戶本地安裝的電子郵件應用程序的電子郵件中? – NinjaCat

+0

是的,我想將附件添加到電子郵件客戶端 –

相關問題