CFMail and outlook365

745 views
Skip to first unread message

Brian Knott

unread,
Jun 21, 2016, 8:01:17 PM6/21/16
to cfau...@googlegroups.com
Hi Guys.
 
Our business is moving all mail account to the cloud.  outlook.office365.com
 
I have been able to get CF, using CFIMAP, to check mail boxes and download attachments.
 
What I can not do is send mail using the CFMail tag.  Example code is below.
 
My understanding is that the connection need to use SSL and port 587.  I have set these and tried various setting, SSL on/off TLS on/off etc.  Each time I get the error below.  Credential make no difference, it does not even check if the user name and password are correct 
 
Anyone had experience in this area?
 
ERROR
 
javax.mail.MessagingException: Could not connect to SMTP host: smtp.office365.com, port: 587; nested exception is: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
 
CODE
 
<cfmail 
    to="bkn...@jbk.com.au
    from="Reciver...@jbk.com.au
    server="smtp.office365.com
    port="587" 
    usessl="yes" 
    useTLS = "yes"
    username="rrep...@jbk.com.au
    password="Jbk123"
    subject="test" 
    type="html">
                    
            
        <html>
            
        <head>
    
        </head>
        <body>
            <h2>The Contractor data load has failed at #timeformat(now(),'hh:mm tt')# on #dateformat(now(),'ddd mmmm yyyy')#</h2>
            
            <h3>Error Details</h3>
            
            
            
        </body>
        </html>
    </cfmail>
 

Charlie Arehart

unread,
Jun 21, 2016, 10:15:51 PM6/21/16
to cfau...@googlegroups.com

Well, if that’s your real username and password, the first thing you’ll want to do is change that, as anyone else who wants to can try to get int. Doh! :-(

Second, it’s curious that cfimap would have no problem connecting but cfmail would. You’re saying it’s the same server? And were you connecting via CFIMAP using tls and/or ssl also? If not, then perhaps it’s that you need to import an SSL cert (into the JVM that you have CF using) so that CF can act as an ssl/tls client to the office365.com server. If you ARE using ssl/tls in the cfimap, with the same connection info, perhaps there’s a difference in the underlying way that cfimap vs cfmail do the ssl/tls communication.

Along those  lines, what version of CF is this (9? 10? 11? 2016?), and what update level? And what JVM version. All these can be seen in the CF Admin “system info” page (the “i” icon in the top right). Later versions of CF and the JVM each address various issues related to SSL (and also include more modern certs, that often avoid the need to have to import one).

Let us know if this starts getting you down the road. There are more details on all the above, but I’ll hold off on the details in case you don’t need them, or this is not taking you toward a good solution.

/charlie

--
You received this message because you are subscribed to the Google Groups "cfaussie" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cfaussie+u...@googlegroups.com.
To post to this group, send email to cfau...@googlegroups.com.
Visit this group at https://groups.google.com/group/cfaussie.
For more options, visit https://groups.google.com/d/optout.

Brian Knott

unread,
Jun 21, 2016, 11:29:15 PM6/21/16
to cfau...@googlegroups.com
I'm not sure if the servers are the same.  CFIMAP points to outlook.office365.com.  CFmail looks at smtp.outlook.office365.com.  They both access the same mailbox.  
 
CFIMAP working tag is below (apart for the changes username and password).
 
<cfimap 
    server = "outlook.office365.com"  
    username = "bkn...@jbk.com.au
    secure="yes"
    port="993"
    action="open" 
    password = "Friday123"
    connection = "curragh_mail"
    generateUniqueFilenames="Yes">
 
There is no SSL certificate installed.  I was looking at importing one, but with CFIMAP working, I figured it was not required.
 
CF version is 11, latest patches applied.  Version number is 11,0,09,299201 
 
Brian
 
 
   
 
 

From: "Charlie Arehart" <charli...@carehart.org>
Sent: Wednesday, June 22, 2016 12:16 PM
To: cfau...@googlegroups.com
Subject: RE: [cfaussie] CFMail and outlook365

Mark Picker

unread,
Jun 23, 2016, 1:25:52 AM6/23/16
to cfaussie, bkn...@jbk.com.au
Hi Brian,

May be nothing but noting that the SMTP server name in your first CFMAIL example is different to your response to Charlie.  Your first example is using smtp.office365.com but in the response you said smtp.outlook.office365.com. Did you just accidently include "outlook" in the response or should your original CFMAIL example really been smtp.outlook.office365.com and is why it isn't working?

Cheers
Mark
Reply all
Reply to author
Forward
0 new messages