我在通过CF 2016发送以下两封电子邮件时遇到问题。当我运行我的代码时,我先收到“密码”电子邮件,然后再收到“用户名”邮件。发送顺序正在改变。我需要先输入“用户名”邮件,然后再输入“密码”邮件。我该如何解决这个问题?
<cfmail to="#toEmail#" from="#fromEmail#" subject="Username" type="html">
Your username is #username#
</cfmail>
<cfmail to="#toEmail#" from="#fromEmail#" subject="Password" type="html">
Your password is #password#
</cfmail>
答案 0 :(得分:1)
你可以随时做这样的事情:
<cfmail to="#toEmail#" from="#fromEmail#" subject="Username" type="html">
Your username is #username#
</cfmail>
<cfthread name="SendPassword" action="run">
<cfscript>
sleep(appropriate number of milliseconds);
</cfscript>
<cfmail to="#toEmail#" from="#fromEmail#" subject="Password" type="html">
Your password is #password#
</cfmail>
</cfthread>
查看您的假脱机设置以获得适当的毫秒数。