I have a coldfusion mail spooler locking up on me everytime I send out an email using this code:
<cfmail TO="xxxx#gmail.com"
FROM="xxxx#xxxxxx.com"
SUBJECT="Your Order!!!!!" type="html">
hello
</cfmail>
Only way I can get this thing to email out of the spooler is to stop IIS and start IIS.
Then it flushes through.
If I use
<cfmail TO="xxxx#gmail.com"
FROM="xxxx#xxxxxx.com"
SUBJECT="Your Order!!!!!" spoolEnable="false" type="html">
hello
</cfmail>
Then the email goes straight through no problem, I would like to use the spooler since it has a less lag for the user.
What's going on with my coldfusion spooler??
I am running 9,0,0,251028 (standard)
BTW: I have tried doing (with no luck):
<cfset sFactory = CreateObject("java","coldfusion.server.ServiceFactory")>
<cfset MailSpoolService = sFactory.mailSpoolService>
<cfset MailSpoolService.stop()>
<cfset MailSpoolService.start()>
This issue seems to be around since at least CF6.x and we haven't been able to find a permanent solution for it. Restarting the mail service is far from perfect.
Some have found that excluding the CF mail spooling directory from the virus scans helped, others say that sending emails with CFMAIL instead of with a cfscript did the job.
Here's a similar SO post and here's one from the Adobe forums
Related
I'm using cfmail tag to send out emails to the user. Additional thing I need to fulfill is to delete the records after sending them to the users. Is there any solution available to observe the cfmail task is whether completed or not. For example like a callback to indicate that the task was done.
With emails there are no guarantees that the email has been delivered.
If the cfmail tag executed without error there will be a record in the cfml spool directory. After the server hands the mail over to your SMTP server coldfusion removes the email from the spool directory.
NOTE: If your server is fast you will never see the mail in the spool folder.
You could try and build a solution that inspects the mail logs, but even that gives you no guarantee that the email has been delivered.
In most cases knowing that cfmail executed is enough.
<cfquery name="emailStuff">
SELECT * FROM mytable
</cfquery>
<cfloop query="emailStuff">
<cfmail>
cfmail contents/properties
</cfmail>
<cfquery>
DELETE FROM mytable WHERE ID=emailStuff.ID
</cfquery>
</cfloop>
Not sure if the above is what you're looking for. But this is a rough example of some code that will delete your DB entry after the mail has been sent.
Also cfmail has properties for failto and debug.
If an email fails it will send the failure email to whomever you specify in failto, or you can use debug to log failed emails.
see: cfmail docs
UPDATE: You could also move the delete query to outside the loop so that it only needs to delete from the database in one swift motion.
<cfloop query="emailStuff">
<cfmail>
cfmail contents/properties
</cfmail>
</cfloop>
<cfquery>
DELETE FROM mytable
WHERE ID IN (<cfqueryparam list="yes" value="#emailStuff.ID#" />)
</cfquery>
XXX is a search engine application which searches for documents contained in various applications including App YYY. The issue is when App YYY document is searched in XXX and clicked to view the same, it is not opening.
Both the applications are in CF10 now and the issue is observed after migration of XXX from CF8 to CF10, earlier XXX was on CF8 and YYY was on CF10 and both applications were working fine.
This is my code snippet -
<!--- check response from application 1 and react accordingly --->
<cfif LEFT(TRIM(UCASE(CFHTTP.fileContent)), 4) is "TRUE">
<cfset request.MoleculeLibraryUser = TRUE>
<cfcookie name="cookie.MolLib_ID" expires="NOW">
<cfelse>
<cfset request.MoleculeLibraryUser = FALSE>
<cfset flag = SetDisplayError("You did not come from a valid molecule library session. Please go back to Molecule Library and log in again.")>
<cfset logonError = TRUE>
<cfif IsDefined("cookie.MolLib_ID")>
<cfcookie name="cookie.MolLib_ID" expires="NOW">
</cfif>
</cfif>
Whenever the user clicks on the search link, it redirects to login page with the error message
"You did not come from a valid molecule library session. Please go back to Molecule Library and log in again."
Please check If you have imported all CF admin settings from CF8 to CF10 esp Allowed IP addresses for the application. If you can give clear error screen shot, it becomes easy to trace. Also check all the dependencies of the viewer are properly configured in CF10.
I'm working on a web app that is ran nightly to retrieve a large XML file from another server. We're using ColdFusion MX7. We run a CFHTTP GET with username, pass, and url. Then we write the field with a cffileaction write to our temp location. So that it can be parsed and sorted into a database. There are a few CFHTTP calls on the page cut one of them is failing. In the CFCatch I have the system email me the catch type and the message and I'm getting this.
COM.Allaire.ColdFusion.HTTPFailure
Connection Failure: Status code unavailable
This the call an write action as is (the credentials are right):
<cfhttp method="GET"
username="#uname#"
password="#pw#"
url="#url#"
resolveurl="yes"
throwonerror="yes">
</cfhttp>
<cffile action="write" file="#getdirectoryfrompath(GetCurrentTemplatePath())#\XML_FileName.xml" output="#cfhttp.fileContent#">
Is anyone familiar with his error?
As it turns out we were getting the Cert from the other groups 'test' server and then trying to using to get things from their production server. So Peter was right! If you run into this problem check out these links:
CFHTTP Over SSL
http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:48687
I am using SendGrid’s SMTP API (not WEB API) and am considering sending an email using cfmail. If I use cfmail to send the email, and want to use the X-SMTPAPI header somewhere, do you think that cfmail is a place to do that? Please clarify.
You would do this by adding a custom header, using the cfmailparam tag. As such:
<cfmailparam
name="X-SMTPAPI"
value="{\"category\":\"Cool Emails\"}">
In context of the cfmail tag it would be as follows.
<cfmail
from="you#example.com"
to="nick#sendgrid.com"
subject="I am using CF Mail to do this!">
<cfmailparam
name="X-SMTPAPI"
value="{\"category\":\"Cool Emails\"}">
Look at my awesome use of cfmail!
</cfmail>
More can be found in the Adobe Documentation
This is what worked for me.
The above suggestion threw errors.
<cfmailparam
name="X-SMTPAPI"
value='{"category":["Cool Emails"]}'>
We have a dedicated server running CentOS and Coldfusion 8.
All cfmail email is routed through Google with cfmail and smtp.
Every now and then, when cfmail is used, the 'FROM' field uses an address from a totally different website.
For instance:
Use form on Site A
Get an email: "Subject: On Site A From: siteb#siteb.com"
Where the from is a completely different variable in another set of code on another part of the server- there is no reason it should see this.
On the other side, sometimes sending an email to sitea#sitea.com has email wind up in Site B inbox, a completely different Google account.
What causes this to happen? Some kind of memory/cache issue? Or is there a funky DNS record causing issue?
Example:
Application.cfm (starts with some UDF includes, and then):
<cfinvoke component="#request.componentPath#.variables" method="getGlobal" />
Variables.cfc (a lot of variables defined within, but here is the cfmail vars):
<cffunction name="getGlobal" access="public" output="false" returntype="void">
<cfscript>
request.siteEmail = "email#mysite.com";
request.siteMailServer = "smtp.gmail.com";
request.siteMailUsername = "root#mysite.com";
request.siteMailPassword = "[redacted]";
</cfscript>
</cffunction>
It sounds like it's possible it could be a var scoping issue, but we can't know for sure until you share some code...
Looks like you're running multiple sites? there's a setting in the CF caching page in admin to do with caching web server paths:
From http://help.adobe.com/en_US/ColdFusion/9.0/Admin/WSc3ff6d0ea77859461172e0811cbf3638e6-7ffc.html :
Disabling the cacheRealPath attribute To ensure that ColdFusion always returns pages from the correct server, disable Cache Web Server Paths in the Caching page of the ColdFusion Administrator. (When you use the multiserver configuration, set the cacheRealPath attribute to false for the ProxyService in the jrun_root/servers/servername/SERVER-INF/jrun.xml file.)
Might not be it, but it's at least quick to try out.