我正在尝试使用new mail()它发送电子邮件,它几乎可以工作.
发送的电子邮件在原始邮件中具有所需内容,但Apple Mail(app)无法读取它.
这是邮件(Apple App)问题还是邮件(ColdFusion对象)问题?
最后但同样重要的是,ColdFusion正在Windows 10上运行
ColdFusion代码
var mail = new mail();
mail.setFrom(application.EMAILFROM);
mail.setTo(arguments.email);
mail.setSubject(application.GSSITE_FULL_NAME & " Password Reset");
mail.addPart( type="plain", charset="utf-8", body="This is a test message." );
mail.send();
Run Code Online (Sandbox Code Playgroud)
电子邮件程序结果
Return-Path: <no-reply@xxx.com>
Received: from 10.211.55.15 (cpe-76-169-198-102.socal.res.rr.com [76.169.198.102]) by mail.xxx.com with SMTP;
Sat, 1 Jul 2017 19:41:27 -0700
Date: Sat, 1 Jul 2017 19:41:26 -0700 (PDT)
From: no-reply@xx.com
To: james@xxx.com
Message-ID: <65588416.79.1498963286429@mail.xxx.com>
Subject: xxx Password Reset
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_Part_78_1984282986.1498963286427"
X-Mailer: ColdFusion 2016 Application Server …Run Code Online (Sandbox Code Playgroud) 我想通过wkhtmltopdf获得一些帮助.
我已下载并安装并尝试使其与我的程序一起正常工作.
我所拥有的是一个允许用户选择打印,预览或优秀的表单.当用户选择打印时,我想要弹出由查询创建的html表,具体取决于所选的关联和位置.
现在,当用户选择打印时,它只是在浏览器中显示该表.
<cfif FORM.Format IS "print">
<!---<cfdocument format="pdf" scale="75" backgroundvisible="yes" overwrite="no" fontembed="yes">--->
<link rel="stylesheet" href="css/form-table.css"/>
<!---<cfdocumentitem type="header" >
<cfoutput><p align= "right">Page #cfdocument.currentpagenumber# of #cfdocument.totalpagecount#</p></cfoutput>
</cfdocumentitem> --->
<div class="RTable">
<h3 class="RTable-h3">CHECKLIST STATS</h3>
<cfoutput>
<ul class="RTable-headingList">
<li>FROM <span class="RTable-headingList-date">#dateFormat(date1, 'mm/dd/yyyy')#</span> TO <span class="RTable-headingList-date">#dateFormat(date2, 'mm/dd/yyyy')#</span></li>
<li>LOCATIONS: <span class="RTable-headingList-locations">#locList#</span></li>
</ul>
</cfoutput>
<table class="table table-hover RTable-table">
<thead>
<tr>
<th>Associate Name</th>
<th>Location</th>
<th><small>Generated by</small>Associate</th>
<th><small>Generated by</small>Selected Location(s)</th>
<th><small>Associate Percentage of</small>Location Total</th>
</tr>
</thead>
<tbody>
<cfoutput query="GetEmployeeInfo">
<tr>
<td class="RTable-name"><cfif rnA EQ …Run Code Online (Sandbox Code Playgroud) 我有一个表单,用户必须从列表中选择值.列表由管理员创建.在其中一个列表中,有一个选项供用户选择NO代表某些保留代码的值.有点像Not Occupied.所以我使用JQuery和AJAX与服务器进行通信.在后端我在生产服务器上使用ColdFusion 9.所以为了带回来,NO我必须将其转换'NO '为空间.如果我不这样做,则会false在客户端返回值.以下是我的代码转换示例:
<cfset convertYesNo = {
YES : "YES ",
NO : "NO "
}>
<cfset qryRecs['value'] = URLEncodedFormat(structKeyExists(convertYesNo, myInfo[CurrentRow]) ? convertYesNo[myInfo[CurrentRow]] : myInfo[CurrentRow])>
Run Code Online (Sandbox Code Playgroud)
上面的代码在我的开发网站上运行良好.唯一的区别是,在发展我们的ColdFusion 10和现场我们的ColdFusion 9,所以一旦我搬到一起住,我开始收到错误消息的代码:
ColdFusion was looking at the following text:<p>{</p><p>The CFML compiler was processing:<ul><li>A cfset tag beginning on line 1071, column 18.<li>A cfset tag beginning on line 1071, column 18.
<pre>1069 : }>
1070 :
<b>1071 : <cfset convertYesNo = {</b>
1072 : "Yes" …Run Code Online (Sandbox Code Playgroud) 好吧,我很难过,我有一个CF11 Web应用程序,它没有通过SQL注入的Web应用程序审计报告,这个报告是由Acunetix制作的.
无论如何,该报告在我的网站上给了我10页,容易受到sql注入,但我检查了代码,我实际上在每个实例中使用cfqueryparam
处理程序调用的其中一个查询的示例
<cfquery datasource="#application.DSN#" name="qResult" result="r">
update #table# s
set s.loader_status = <cfqueryparam cfsqltype="cf_sql_varchar" value="#ucase(arguments.status)#">
<cfif isDefined("bio_loader_status") and bio_loader_status neq ''>
, s.bio_loader_status = <cfqueryparam cfsqltype="cf_sql_varchar" value="#ucase(bio_loader_status)#">
</cfif>
, s.session_id = NULL
, s.session_expiration = NULL
<cfif isDefined("arguments.rowid") and arguments.rowid neq ''>
where s.rowid = CHARTOROWID(<cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.rowid#">)
</cfif>
</cfquery>
Run Code Online (Sandbox Code Playgroud)
我读过的所有内容都告诉我,我可以防止sql攻击(使用cfquery param,使用datasurce和table变量等),但报告另有说法
URL encoded GET input rowid was set to 1'"
Error message found: Error Executing Database Query
GET /index.cfm/status?rowid=1'%22&type=billing HTTP/1.1
Run Code Online (Sandbox Code Playgroud)
有人能说清楚我做错了吗?或者报告的假设是否正确?
Lucee 5.2,SQL Server 2014
我有一个表单,不会将新记录插入我的SQL Server 2014数据库.
我已经研究了这个问题几天几夜,无法弄清楚发生了什么.我没有收到任何类型的错误消息.我填写表单,单击"提交"按钮,然后返回到空白表单.没有记录插入数据库表.
我在下面测试了我的代码的删节版本,但我仍然得到相同的结果:没有插入; 并且Lucee根本没有给我任何错误信息.
<!--- set a default value "" for RegisterID in scope URL --->
<cfparam name="url.RegisterID" default="">
<!--- define the RegisterID in scope FORM, then set form.RegisterID equal to the RegisterID passed in the URL --->
<cfparam name="form.RegisterID" default="#url.RegisterID#">
<!--- set default values for other user-editable fields --->
<cfparam name="form.Title" default="">
<cfparam name="form.x_first_name" default="">
<cfparam name="form.DateCreated" default="">
<cfparam name="form.DateModified" default="">
<!--- query editRegister tells Lucee which record to edit--->
<cfquery datasource="nnvawi" name="editRegister"> …Run Code Online (Sandbox Code Playgroud) 我希望使用来自javascript的加法和减法的值,并使用它们将startRow和endRow值一起递增.我有加法和减法工作,并显示值.现在我无法弄清楚如何在引号内添加值.每次我尝试使用##变量标记时,它都会告诉我我的变量不存在.我希望能够按下下一个和上一个按钮,让它显示前者和后20个结果.`
<cfoutput>
<script type="text/javascript">
var currentValue = 0;
var add = function(valueToAdd){
("adding: " + valueToAdd);
currentValue += valueToAdd;
document.getElementById('number').innerHTML = currentValue;
};
</script>
</cfoutput>
<cfparam name="url.start" default="1" >
<cfquery name="query" datasource="">
</cfquery>
<table>
<cfset totalPages = ceiling(query.recordCount)>
<cfset thisPage = ceiling(url.start)>
<cfloop query="query" startRow="1" endRow="20">
<cfoutput>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</cfoutput>
</cfloop>
</table>
<html>
<head>
</head>
<body>
<div id="text">Results = <span id="number">0</span><div>
<a href="javascript:add(20)">Plus 20 Results</a>
<a href="javascript:add(-20)">Minus 20 Results</a>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我从代码中删除了数据库信息.
我有一个备忘录字段中的字符串,上面有一些信用卡,我想掩盖这些数字只显示最后4位数字.例:
<cfset str = "Her card no. is 1234567890123456 which is a bogus number.">
Run Code Online (Sandbox Code Playgroud)
如何使str的值读取:
她的卡号.是************3456这是一个虚假号码.
例如,在PHP中,您可以:
<?= var_dump($myVariable); ?>
Run Code Online (Sandbox Code Playgroud)
并查看整个变量的转储及其所有可用属性.如何在带有.cfm扩展名的coldfusion模板中执行此操作(换句话说,在视图层中不是控制器)?
我们正在使用ESLint和ESlint HTML插件。我们遇到了一个问题,我们正在使用<!---
Coldfusion 注释,而eslint会将注释中的
所有内容都解析为javascript。有没有办法告诉eslint忽略两者之间的一切
<!--- and --->
我想在CF中编写一个函数,该函数具有返回多列的查询。我研究并阅读,仅能找到带有sql查询的函数示例,仅返回结构的表视图。
如何在CF中使用SQL查询编写函数并以文本格式输出每一列
我一直在搜索它,并在教程网站上寻找运气,
<cffunction name="queryListEmployee" returntype="query" output="false">
<cfargument name="EMPID" type="numeric" default="1"/>
<cfset var listEmployee = ""/>
<cfquery name="local.listContractors" datasource="DB">
SELECT E.FIRSTNAME, E.LASTNAME
FROM EMPLOYEE E
WHERE E.ID = <cfqueryparam value="#arguments.EMPID#" cfsqltype="cf_sql_decimal" scale="0"/>
</cfquery>
<cfreturn local.listEmployee/>
Run Code Online (Sandbox Code Playgroud)
我希望能够输出列名称,例如queryListEmployee.firstname和queryListEmployee.lastname
coldfusion ×10
cfml ×2
html ×2
javascript ×2
cfdump ×1
cfquery ×1
coldfusion-9 ×1
email ×1
eslint ×1
forms ×1
lucee ×1
macos-sierra ×1
masking ×1
sql-server ×1
wkhtmltopdf ×1