> In the CF admin, I set the mail server as 127.0.0.1, but the
> mail is not being delivered, is there anything else I have to
> do in the CF admin to test cfmail locally?

So you have an e-mail server installed and configured on your
computer?  ColdFusion will attempt to deliver the message to whatever
e-mail server is specified and that server is expected to then relay
it out to its final destination.  If you're on Windows you can use the
IIS SMTP service to handle this for you if it's configured properly.
Once the code is at your ISP, use their e-mail server name for
outgoing e-mail.  If you do have a mail server configured, I would
check the e-mail logs that ColdFusion keeps under its log folder which
will give you more information as any issues it's running into.

> I have to set this up using the <cfschedule> tags as my hosting
> company does not support scheduled tasks, as they told me to
> set up a cron task in cpanel, which I don't even know what that is.

FYI, the CFSCHEDULE tag creates a ColdFusion scheduled task in the CF
admin.  I don't recall off-hand if scheduled tasks in CF can be
disabled completely, but if they have disabled CF's scheduled tasks
entirely then the CFSCHEDULE tag won't work either.  Linux has a
scheduling program called "cron" which is essentially its way of
handling scheduled tasks for the operating system.  The tasks that get
scheduled are referred to as "jobs", hence "cron jobs".  Their web
hosting control panel (cpanel) allows you to add your own tasks to the
scheduler.  Since you need to call a URL, you would need to look into
adding a cron job that uses the "curl" program (short for "call url")
to hit the URL for you instead of the CF scheduler if it's not
supported.

> SELECT *

Unrelated, but it's generally considered bad practice to use * in a
select statement unless you really need to.  Generally, your queries
will be easier to understand and perform better if you specify the
columns to select out.

> <cfloop query="GetUsers">
>  <cfmail To="#GetUsers.email_address#"

Also unrelated, but one trick I usually put in with a case like this
is wrapping the CFMAIL tag with a check to ensure the e-mail address
is valid, such as:

<cfloop query="GetUsers">
  <cfif isValid("email", GetUsers.email_address)>
    <cfmail to="#GetUsers.email_address#" ...>
      ...
    </cfmail>
  </cfif>
</cfloop>

This ensures that a malformed e-mail address won't gum up the works
and unexpectedly break your scheduled process.


-Justin Scot

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:5790
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm

Reply via email to