Problem running CFMAIL from coldfusion8, developers version

Hi, I am in the process of setting up an email notification capability, whereby changes to the order entry table will be emailed automatically when they occur. I am using coldfusion8, developer version, prior to putting it into production.

My plan is to use cfmail, embedded into dynamic page - in conjunction with scheduling from coldfusion8

At the moment I am checking out cfmail and cant get it to send mails when I run a test page with the code - see code below. I am attaching the mail settings I am currently using with coldfusion8 mail.

Can someone spot my silly mistake  and save me from insanity !!

many thanks

james
<CFMAIL server="localhost:8501"
            to="jamesdkane@gmail.com"
            from="jamesdkane@gmail.com"
            Subject="registration update">
            qsdfqsdfqsdfqsdfqsfdqsdf qsd fqsmlml
 </CFMAIL>

Open in new window

emailweb.jpg
jameskaneAsked:
Who is Participating?
 
azadisaryevCommented:
@_agx_: no, the SERVER attribute of cfmail tag is NOT limited to any cf server edition - it works fine in all editions. you usually have to also specify USERNAME and PASSWORD attributes when you use the SERVER attribute.

@jameskane: _agx_ is correct otherwise - you have a wrong mail server setup in CF Admin, and you have wrong SERVER attribute in your <cfmail> tag.
you do not really need to set up mail server in CF Admin - all you need is to provide all required mail server connection attributes in your <cfmail> tag:

<cfmail
  server="smtp.gmail.com"
  port="587"
  useTLS="true"
  username="jamesdkane@gmail.com"
  password="jamesdkane-ACCOUNT-PASSWORD-HERE"
  from="jamesdkane@gmail.com"
  to="jamesdkane@gmail.com"
  Subject="registration update">
...mail message here...
</cfmail>


Azadi
0
 
duncancummingCommented:
Firstly, if you're just using the default settings as you've already specified in CF Administrator, you don't need to repeat the value for server in your <cfmail> tag.  

Secondly, you specify the server as localhost:8501, but in CF Administrator, the Server Port value says 25.  Specify server as just localhost, and change Server Port to 8501.

0
 
_agx_Commented:
You need to set the mail server value in the CF Administrator to a valid smtp server and port.  So the address would not be 127.0.0.1, unless you are running an smtp server on that same machine.  Here is a link that talks about using gmail smtp.  

     http://jamiekrug.com/blog/index.cfm/2009/2/13/cfmail-using-Gmail-SMTP

Bear in mind it is common for public mail servers (yahoo, etc..) to have restrictions to help minimize spam.  Some don't allow relaying. So you may want to try it with an internal server mail server first.

> <cfmail server="localhost:8501"

BTW,  I believe the "server" attribute is restricted to the Enterprise and Developer editions.  So don't use that attribute unless you are running the Enterprise version on your production site.
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
jameskaneAuthor Commented:
Many thanks everyone for your help. Azadi, that was fantastic - cant say I understand it, but it  WORKS !!  I will keep it as one of my most treasured templates !!!

THANKS again everyone for you time.
0
 
_agx_Commented:
@azadisaryev,

That is not what the documentation says:
http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_m-o_01.html
0
 
_agx_Commented:
You're welcome James ;-)
0
 
jameskaneAuthor Commented:
Just to give a little back - I am attaching image with the settings I made to the coldfusion8 scheduled task to automatically trigger the email. All that was necessary was to put in  a pointer to the page which contains the email code (and of course the magic reporting tags) - and give it my coldfusion  un/pw. I have set it to run every 10 minutes after 8:05AM - for testing. This will be set to a specific time each day when I finish it.


SO, to summarize, I have used the coldfusion scheduler to automatically launch a page at a certain time. That page contains the database reporting infor and the cfmail tag to send the report to the user.

Hope this might be of some small added value to someone else

jame
scheduledtask.jpg
0
 
azadisaryevCommented:
@_agx_: as far as i can see, the docs mention CF Enterprise only in regard to specifying MULTIPLE smtp servers in SERVER attribute. CF Standard does not support this feature - if you specify multiple mail servers it will use only the first one specified - but it does support SERVER attribute.

@jameskane: you are welcome! you may want to check out the docs for <cfmail> tag (see link in _agx_'s post above) for other attributes you can use.

Azadi

0
 
_agx_Commented:
@azadisaryev,

My recollection from the last time I used the professional version was that it did not work.  But since I haven't used that version in eons, I could be wrong.  
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.