2012-08-03 58 views
0

在这里我需要发送一个邮件mailto(html)mail_to(rails)函数。但问题出在邮件正文,如何用mailto功能附上邮件正文,我的意思是,当我点击这个链接时,一个Gmail客户端会打开,因此我需要在客户端正文部分获取imageURLmailto与Rails中的HTML问题

<script type="text/javascript"> 
var **imageURL**; 
function code (email) { 

    imageURL = "https://chart.googleapis.com/chart? 
    chs=150x150&cht=qr&chl=13&choe=UTF- 
    8"; 
    $("#image_url").val(imageURL); 
    $("#mailhere").html("<a class='btn btn-primary pull-left' 
    href='mailto:"+email+"'>**Mail**</a>"); 
} 


<div class="modal-footer" id="qr-code-footer"> 
<a id="printme" href="#" class="btn btn-primary pull-left">Print</a> 
    <div id="mailhere" class="span1"> 
    </div> 
</div> 

谢谢

回答

0

使用&body=Content

$("#mailhere").html("<a class='btn btn-primary pull-left' href='mailto:"+email+"&body=" + encodeURIComponent(imageURL) + "'>**Mail**</a>"); 
+0

同样的情况,所有这些[email protected]&body=https://chart.googleapis.com/chart CHS = 150×150&CHT = QR和CHL = 59&崔= UTF-8来到“To”地址栏。 但是如何在Gmail客户端的Body部分显示正文部分? – amtest 2012-08-03 17:22:02

+0

当我使用像这样的href ='mailto:“+ email +”?subject = Qcode“+ branch +”&body =点击这里获取代码“+ encodeURIComponent(imageURL)+”'> Mail“; – amtest 2012-08-12 16:24:24