Copy link to clipboard
Copied
How is it that someone sends an email from an email client and then that email can be saved to a database.
I realize I can use CFPOP to load the emails and then use CFquery to store it but that's all manual.
Can I get it to happen once the email comes in?
Also is it possible to create pop accounts using Coldfusion?
Thanks!
Copy link to clipboard
Copied
ColdFusion IS NOT a mail server. It is really only a mail client using the POP and SMTP protocols to receive and send messages to a mail server just like any other client; i.e. Outlook, Thunderbird, etc.
Only the mail server know when the email comes in. If you want something to be triggered by that event, it will need to be triggered from the mail server. Fully featured mail servers sometimes have the ability to take actions like this. But you will need to dig into your mail server documentation to find out.
But, it is pretty rare that one needs to fire off an event AS SOON AS an email arives. Most people are happy just setting up a scheduled task to fire off every x minutes (1,10,15, whatever works) to see if there are any new messages. That is very easy to automate with ColdFusion.
P.S. The latest version of ColdFusion can now also communicate with Exchange servers in it's native protocol. But ColdFusion is still just a client in that relationship.
Copy link to clipboard
Copied
I see. I guess something I'm gonna have to look into. Thanks!
Copy link to clipboard
Copied
In addition to what Ilssac said, you may want to examine the contents of the email before storing it. It might contain something nefarious.