javascript
  • html
  • email
  • 2012-10-31 27 views 1 likes 
    1

    可能重複:
    MailTo with HTML body內容

    我想從JavaScript發送電子郵件。我發現這個帖子幫助我很多Sending emails with Javascript

    但我需要在電子郵件內容中添加圖像,粗體文本和顏色更改。

    任何幫助?

    我想什麼:

    var content = "I want to send email from javascript. <span style='color:red'>I found this post which helped me alot</span><img src='logo.png'/> Sending emails with Javascript" 
    
    var link = "mailto:[email protected]" 
         + "[email protected]" 
         + "&subject=" + escape("This is my subject") 
         + "&body=" + escape(content); 
    
    window.location.href = link; 
    
    +0

    顯示您想要通過郵件發送的html代碼 – Toretto

    +1

    這是不可能的。 http://stackoverflow.com/questions/5620324/mailto-with-html-body – Dev

    +0

    @Tornado更新了我的文章。 – user10

    回答

    1

    我不認爲這是可能的。據我所知,你可以通過\ n換新線

    "mailto:[email protected]?body=xx " + escape("\n") + " xx" 
    

    爲什麼不讓用戶在電子郵件客戶端寫入conent?

    相關問題