Cold Fusion not connecting to SMTP Host

I am getting an error when trying to send email through my Coldfusion server - using CF 9.0

The error is as follows:  "Error","scheduler-2","08/28/13","09:28:03",,"Could not connect to SMTP host: MAILSERVER, port: 25"

I have other applications and websites (non coldfusion) that are able to send emails to the same MAILSERVER without any problems at all.

Can you help me out?
tulsaokmisAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gurpreet Singh RandhawaCEOCommented:
how are you connecting with smtp, can i see the code, you can hide the smtp ifor but show me the way you are connecting, make sure you put username/password if necessary
0
tulsaokmisAuthor Commented:
I am using the ColdFusion System Setting GUI....The SMTP doesnt require a user ID and Password.

Like I said, on the SAME server other applications are connecting, configured the same way, with just the SMTP host address.  Here is the code in the neo-mail.xml file:

<wddxPacket version='1.0'><header/>
<data>
<struct type='coldfusion.server.ConfigMap'>
  <var name='keyalias'>
    <string></string>
  </var>
  <var name='sign'>
    <boolean value='false'/>
  </var>
  <var name='undeliverdir'>
    <string>{neo.rootdir}/Mail/Undelivr</string>
  </var>
  <var name='severity'>
    <string>warning</string>
  </var>
  <var name='keypassword'>
    <string></string>
  </var>
  <var name='mailsentloggingenable'>
    <boolean value='false'/>
  </var>
  <var name='schedule'>
    <number>15.0</number>
  </var>
  <var name='keystore'>
    <string></string>
  </var>
  <var name='port'>
    <number>25.0</number>
  </var>
  <var name='keystorepassword'>
    <string></string>
  </var>
  <var name='usessl'>
    <boolean value='false'/>
  </var>
  <var name='spooldir'>
    <string>{neo.rootdir}/Mail/Spool</string>
  </var>
  <var name='spoolenable'>
    <boolean value='true'/>
  </var>
  <var name='username'>
    <string></string>
  </var>
  <var name='password'>
    <string></string>
  </var>
  <var name='usetls'>
    <boolean value='false'/>
  </var>
  <var name='server'>
    <string>MAILSERVER</string>
  </var>
  <var name='timeout'>
    <number>120.0</number>
  </var>
</struct>
</data>
</wddxPacket>

Open in new window



WHen I am under CF Admin in the GUI/web I see the proper settings, but then if I click on "verify mail server connection" then click "Submit Changes" I get a "Connection Verification Failed".

CFusion Admin Screenshot
0
Gurpreet Singh RandhawaCEOCommented:
MAILSERVER needs to some IP address or actually a mail sending host such as:

mail.mywebsite.com

if that host requires username/password, use that info and fill in the info and enter theport if it normal authentication and if it is ssl or tls, you have enter it as [in this say google, uses 465]

Try this and then click verify. it should get u going
0
Newly released Acronis True Image 2019

In announcing the release of the 15th Anniversary Edition of Acronis True Image 2019, the company revealed that its artificial intelligence-based anti-ransomware technology – stopped more than 200,000 ransomware attacks on 150,000 customers last year.

tulsaokmisAuthor Commented:
I know that.  I put in MAILSERVER so as to hide  our actual mailserver......I have our actual mail server in the correct spot.
0
SidFishesCommented:
There are several posts I've seen that claim there is a bug in CF9 in some cases that prevents the use of mail settings in cfadmin but will allow mail to send properly if you use the cfmail tag to handle the settings. I can't verify as I am running CF8 & CF10.

Try removing the the setting in cfadmin and set up the connection to your SMTP server using tag attributes and see what happens.

I've also seen reference to this error in conjunction with mail stuck in the queue. Have a look at

\cfusion\Mail\spool\
\cfusion\Mail\undelivr\

and clear out anything that may be there.
0
tulsaokmisAuthor Commented:
so clear out all files in the Spool and Undelivr Folders?
0
SidFishesCommented:
Yes try that although you might want to dump them in a backup folder.
0
Tomarse111Commented:
Have you tried telnetting to port 25 on your smtp server to see if its actually connectible from your CF server?

The telnet should be run on your CF server.

if you don't know how to do this:

Run > CMD
type: telnet MAILSERVER 25

see if it connects

Tom

edit:

Presuming its a windows box.
0
tulsaokmisAuthor Commented:
yes I have tried telnetting as it connects just fine, as stated previously other applications on the same server work just fine sending emails to the same SMTP server.
0
tulsaokmisAuthor Commented:
I emptied \cfusion\Mail\undelivr\ as it had quite a few files, but there was nothing in the spool folder.  Still no luck.

I tried using the <cfmail> tags and it did not work either.
0
SidFishesCommented:
can you post a sanitized version of your cfmail tag
0
tulsaokmisAuthor Commented:
<cfmail to="emai@address.com" 
        from="email@address.com" 
        subject="test email" 
        server = "MAILSERVER"
        port="25"
        spoolenable="yes"
        debug="yes"
        type="plain">
	email test
</cfmail>

Open in new window

0
SidFishesCommented:
Is this the -full- error message

Error","scheduler-2","08/28/13","09:28:03",,"Could not connect to SMTP host: MAILSERVER, port: 25
0
SidFishesCommented:
Oh - just had a thought.

By default, the CF service runs as local system which may not be able to query DNS so you may get an error if you call your server via smtp.mailerver.com

You can try to use the IP or my preference is to create an AD account for the coldfusion service to run under. This allows you to allow/deny CF access to various network resources such as AD services and network shares
0
tulsaokmisAuthor Commented:
Yes that is the full error.

I have tried the IP instead of the DNS name.  Again I can telnet to the mail server but I am not able to use it in CF.

This server is not on a domain, it is in a hosted envronment on the opposing side of a DMZ.

When using the CFMAIL Tag I get:  Error: javax.mail.MessagingException ** Could not connect to SMTP host: MAILSERVER, port: 25
End of page.

The error I see in the Mail.Log file is:

"Error","scheduler-0","09/11/13","13:47:08",,"Could not connect to SMTP host: MAILSERVER, port: 25"
"Error","scheduler-2","09/11/13","13:48:24",,"Could not connect to SMTP host: MAILSERVER, port: 25"
"Error","scheduler-1","09/11/13","14:41:11",,"Could not connect to SMTP host: MAILSERVER, port: 25"
"Error","scheduler-2","09/12/13","09:17:36",,"Could not connect to SMTP host: MAILSERVER, port: 25"
"Error","scheduler-0","09/12/13","09:32:53",,"Could not connect to SMTP host: MAILSERVER, port: 25"
0
SidFishesCommented:
does your mail server require TLS or SSL?
0
SidFishesCommented:
If you've got access, you might want to look at the smtp server logs to see if you are seeing the errors there (ie: authentication failures)

because of the way CF error reporting is, that error may not mean there was no connection, just a connection it wasn't able to use....
0
tulsaokmisAuthor Commented:
No it does not require SSL or TLS.  Remember I have applications on the same server as the Cold Fusion and they are sending email through the same settings without issue, same IP, same DNS entry, same server.

Cold fusion is the only software on this server they is having the issue....

Also it has worked at one point in the past, it just stopped working and I cannot figure out why.  I am almost at the point of uninstalling CF9 and reinstalling it to see if that solves the problem.
0
dgrafxCommented:
can you post the code used to send mail from one of your other apps (that send mail ok).

thanks
0
_agx_Commented:
@tulsaokmis - If you're not seeing anything more detailed in the logs, you should enable debugging ie <cfmail debug="true" ..>. That writes the full transaction between CF and the mail server to the logs.  Please note the two caveats mentioned in the docs:

http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7f8e.html

CFMAIL debug=yes:
--------------
sends debugging output to standard output. By default, if the console window is unavailable, ColdFusion sends output to cf_root\runtime\logs\coldfusion-out.log on server configurations. On J2EE configurations, with JRun, the default location is jrun_home/logs/servername-out.log. Caution: If you set this option to yes, ColdFusion writes detailed debugging information to the log, including all message contents, and can generate large logs quickly.
0
tulsaokmisAuthor Commented:
I found this error in the Exception.Log File:

"Error","scheduler-2","09/11/13","13:48:24",,"Could not connect to SMTP host: MAILSERVER, port: 25"
javax.mail.MessagingException: Could not connect to SMTP host: MAILSERVER, port: 25;
  nested exception is:
      java.net.ConnectException: Connection refused: connect
      at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1545)
      at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:453)
      at javax.mail.Service.connect(Service.java:291)
      at coldfusion.mail.MailSpooler.getConnection(MailSpooler.java:1199)
      at coldfusion.mail.MailSpooler.deliver(MailSpooler.java:984)
      at coldfusion.mail.MailSpooler.sendMail(MailSpooler.java:905)
      at coldfusion.mail.MailSpooler.deliverStandard(MailSpooler.java:1275)
      at coldfusion.mail.MailSpooler.run(MailSpooler.java:1240)
      at coldfusion.scheduling.ThreadPool.run(ThreadPool.java:201)
      at coldfusion.scheduling.WorkerThread.run(WorkerThread.java:71)
Caused by: java.net.ConnectException: Connection refused: connect
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
      at java.net.Socket.connect(Socket.java:519)
      at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:265)
      at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:227)
      at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1511)
0
dgrafxCommented:
did someone already say to TRY connecting with SSL or TLS and / or TRY sending username password ?

I don't recall ...
0
tulsaokmisAuthor Commented:
our SMTP host doesnt require a user ID or Password.  It is setup through the IP of the server, which I know is setup correctly becuase other apps on this server are working just fine.

On another note, I just tested again and it decided to start working. so who knows.  I will keep monitoring over the next few days to see if it stops working.

Thanks to all for the suggestions.  I am starting to think it really is a Bug in CF9.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
_agx_Commented:
If it was a localized thing, you may just want to delete the thread. ie No reason adding it to the archives if there's no real answer.
0
tulsaokmisAuthor Commented:
The issue worked itself out.  No real answer here....
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.