如何使用mailto使用电子邮件发送表html? [英] How to send table html with email using mailto?

查看:485
本文介绍了如何使用mailto使用电子邮件发送表html?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用href =mailto ..发送电子邮件。
我有以下工作代码:

 < cfset month = URL.Month> 
< cfset year = URL.Year>
< cfquery datasource =newslettersname =testing>
SELECT * FROM departments_names
其中,日期> ='#datestart#'和日期< #dateend#
AND shooting_star_dept_name is NOT NULL
ORDER BY
DATEPART(year,dates),
DATEPART(month,dates),
< / cfquery>

< cfoutput query =testingGROUP =deptartmetn_name>
< tr>
< td>
< a href =mailto:?subject =#month#/#year#%20%20Results%20for%20newsletters&
body =#total_count#%20#total / total_count#>
发送电子邮件至#deptartmetn_name#< / a>< / td>
< / tr>
< / cfoutput>

这只是发送一个简单的12/2
我想能够发送不仅仅是简单的文本。
当我点击一个链接,可以发送如下的表:

 < table> ; 
< thead>
< th>名字< / th>
< th>姓氏< / th>
< th>总< / th>
< / tr>
< / thead>
< cfoutput query =testing>
< tbody>
< tr>
< td>#employee_name#< / td>
< td>#employee_lastname#< / td>
< td>#total_count#< / td>
< / tr>
< / tbody>
< / cfoutput>
< / table>

我想看看我先发送给收件人。
这样的东西是可能的,还是有更好的方法来做到这一点?
我的第一篇文章和初学者编码。

解决方案

你可以使用AJAX回调你的链接, code> cfmail 与回调处理程序代码中的 cfsavecontent (用于实际的HTML内容/

I want to send a email using a href="mailto.." I have this working code below:

<cfset month = URL.Month>
<cfset year = URL.Year>
<cfquery datasource="newsletters" name="testing">
SELECT * FROM departments_names
where dates >='#datestart#' and dates < #dateend#
AND shooting_star_dept_name IS NOT NULL
ORDER BY
DATEPART(year, dates),
DATEPART(month, dates),
</cfquery>

<cfoutput query="testing" GROUP="deptartmetn_name">
<tr>
<td>
<a href="mailto:?subject=#month#/#year#%20%20Results%20for%20newsletters&
body=#total_count#%20#total/total_count#">
Send email to #deptartmetn_name#</a></td>
</tr>
</cfoutput>

Which just send a simple "12/2" (for example). I would like to be able to send more than just simple text. I would like when i click on a link to be able to send a table like below:

<table>
<thead>
<tr >
<th> First Name</th>
<th> Last Name</th>
<th>total</th>
</tr>
</thead>
<cfoutput query="testing">
<tbody>
<tr >
<td>#employee_name#</td>
<td>#employee_lastname#</td>
<td>#total_count#</td>
</tr>
</tbody>
</cfoutput>
</table>

I would like to see what I'm sending first to the recipient. Would something like this be possible or is there a better way to do this? My first post here and beginner to coding.

解决方案

You could use an AJAX callback on your links and use cfmail with cfsavecontent (for the actual HTML content/body of the message) in your callback handler code.

这篇关于如何使用mailto使用电子邮件发送表html?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆