receive email using cfmail

is it possible to receive email using cfmail. if not, is it something else? cfftp?  i want to be able to check email using a browser window.
phillystyle123Asked:
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.

MauseCommented:
well almost its cfpop

to get only the headers
<cfpop action="GETHEADERONLY" name="allheaders" server="#server#">

<cfoutput query = "allheaders">
From: #From# - Subject: #Subject#
</cfoutput>

use getAll  in the action to get the rest of the mail

Mause
0
anandkpCommented:
Hi,
yes CFPOP is teh answere ... heres a example of what i had written when i first tried it :)

<CFPOP SERVER="#MAILSEVER_IP#" USERNAME="anand" PASSWORD="anand" ACTION="GetAll" NAME="getmail" GENERATEUNIQUEFILENAMES="YES">

<TABLE WIDTH="98%" ALIGN="center" CELLPADDING="0" CELLSPACING="0" BORDER="0">
      <TR BGCOLOR="000099">
            <TD BGCOLOR="000099" WIDTH="100%">      
                  <TABLE WIDTH="100%" ALIGN="center" CELLPADDING="3" CELLSPACING="1" BORDER="0">
                        <TR BGCOLOR="000099">
                              <TD WIDTH="19%"><FONT FACE="Verdana" SIZE="2" COLOR="ffffCC"><B>Total eMails</B></FONT></TD>
                              <TD WIDTH="1%"><FONT FACE="Verdana" SIZE="2" COLOR="ffffCC"><B>:</B></FONT></TD>
                              <TD WIDTH="80%" COLSPAN="4"><FONT FACE="Verdana" SIZE="2" COLOR="ffffCC"><B><CFOUTPUT>#getmail.RecordCount#</CFOUTPUT></B></FONT></TD>
                        </TR>
                        <CFOUTPUT QUERY="getmail">      
                              <TR BGCOLOR="FFFFFF">                  
                                    <TD COLSPAN="6" BGCOLOR="e9e9e9"><FONT FACE="Verdana" SIZE="2">&nbsp;</FONT></TD>
                              </TR>
                              <TR BGCOLOR="FFFFFF">
                                    <TD WIDTH="19%"><FONT FACE="Verdana" SIZE="2">Number</FONT></TD>
                                    <TD WIDTH="1%"><FONT FACE="Verdana" SIZE="2">:</FONT></TD>
                                    <TD WIDTH="30%"><FONT FACE="Verdana" SIZE="2">#getmail.messagenumber#</FONT></TD>                  
                                    <TD WIDTH="19%"><FONT FACE="Verdana" SIZE="2">Date</FONT></TD>
                                    <TD WIDTH="1%"><FONT FACE="Verdana" SIZE="2">:</FONT></TD>
                                    <TD WIDTH="30%"><FONT FACE="Verdana" SIZE="2">#getmail.date#</FONT></TD>
                              </TR>
                              <TR BGCOLOR="FFFFFF">
                                    <TD><FONT FACE="Verdana" SIZE="2">From</FONT></TD>
                                    <TD><FONT FACE="Verdana" SIZE="2">:</FONT></TD>
                                    <TD><FONT FACE="Verdana" SIZE="2">&nbsp;#getmail.from#&nbsp;</FONT></TD>
                                    <TD><FONT FACE="Verdana" SIZE="2">Reply To</FONT></TD>
                                    <TD><FONT FACE="Verdana" SIZE="2">:</FONT></TD>
                                    <TD><FONT FACE="Verdana" SIZE="2">&nbsp;#getmail.replyto#&nbsp;</FONT></TD>
                              </TR>
                              <TR BGCOLOR="FFFFFF">
                                    <TD><FONT FACE="Verdana" SIZE="2">To</FONT></TD>
                                    <TD><FONT FACE="Verdana" SIZE="2">:</FONT></TD>
                                    <TD><FONT FACE="Verdana" SIZE="2">&nbsp;#getmail.to#&nbsp;</FONT></TD>
                                    <TD><FONT FACE="Verdana" SIZE="2">CC</FONT></TD>
                                    <TD><FONT FACE="Verdana" SIZE="2">:</FONT></TD>
                                    <TD><FONT FACE="Verdana" SIZE="2">&nbsp;#getmail.cc#&nbsp;</FONT></TD>
                              </TR>
                              <TR BGCOLOR="FFFFFF">
                                    <TD><FONT FACE="Verdana" SIZE="2">Subject</FONT></TD>
                                    <TD><FONT FACE="Verdana" SIZE="2">:</FONT></TD>
                                    <TD COLSPAN="4"><FONT FACE="Verdana" SIZE="2">&nbsp;#getmail.subject#&nbsp;</FONT></TD>
                              </TR>
                              <TR BGCOLOR="FFFFFF">
                                    <TD><FONT FACE="Verdana" SIZE="2">Message</FONT></TD>
                                    <TD><FONT FACE="Verdana" SIZE="2">:</FONT></TD>
                                    <TD COLSPAN="4"><FONT FACE="Verdana" SIZE="2">&nbsp;#getmail.body#&nbsp;</FONT></TD>
                              </TR>            
                        </CFOUTPUT>                        
                  </TABLE>
            </TD>
      </TR>
</TABLE>

run this page with ur server_ip & mail settings !

HTH

K'Rgds
Anand
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
substandCommented:
you'll need to use cfpop... here are the docs on it:



CFPOP
CFPOP retrieves and deletes email messages from a POP mail server. See also CFMAIL.

Syntax
<CFPOP SERVER="servername"
    PORT="port_number"
    USERNAME="username"
    PASSWORD="password"
    ACTION="action"
    NAME="queryname"
    MESSAGENUMBER="number"
    ATTACHMENTPATH="path"
    TIMEOUT="seconds"
    MAXROWS="number"
    STARTROW="number"
    GENERATEUNIQUEFILENAMES="boolean">

SERVER
Required. Host name (biff.upperlip.com) or IP address (192.1.2.225) of the POP server.

PORT
Optional. Defaults to the standard POP port, 110.

USERNAME
Optional. If no user name is specified, the POP connection is anonymous.

PASSWORD
Optional. Password corresponds to user name.

ACTION
Optional. Specifies the mail action. There are three possible values:

GetHeaderOnly -- (Default) Returns message header information only.
GetAll -- Returns message header information, message text, and attachments if ATTACHMENTPATH is specified.
Delete -- Deletes messages on the POP server.
Note  Two retrieve options are offered to maximize performance. Message header information is typically short and therefore quick to transfer. Message text and attachments can be very long and therefore take longer to process. See the Message Header and Body Columns table, which follows the CFPOP attribute descriptions, for information on retrieving header and body information form the query when you specify GetHeaderOnly or GetAll.  



NAME
Optional. The name you assign to the index query. Required for ACTION="GetHeaderOnly" and ACTION="GetAll".

MESSAGENUMBER
Optional. Specifies the message number(s) for the given action. MESSAGENUMBER is required for ACTION="Delete". If it is provided for ACTION="GetHeaderOnly" or ACTION="GetAll", only referenced messages will be retrieved. If it is omitted for ACTION="GetHeaderOnly"or ACTION="GetAll", all messages available on the server are returned.

MESSAGENUMBER can contain individual message numbers or a comma-separated list of message numbers. Invalid message numbers will be ignored.

ATTACHMENTPATH
Optional. Allows attachments to be written to the specified directory when ACTION="GetAll". If an invalid ATTACHMENTPATH is specified, no attachment files are written to the server.

TIMEOUT
Optional. Specifies the maximum amount of time in seconds to wait for mail processing. Defaults to 60 seconds.

MAXROWS
Optional. Specifies the maximum number of entries for mail queries. This attribute is ignored if MESSAGENUMBER is specified.

STARTROW
Optional. Specifies the first row number to be retrieved. Default is 1. This attribute is ignored if MESSAGENUMBER is specified.

GENERATEUNIQUFILENAMES
Optional. Boolean indicating whether to generate unique file names for the files attached to an email message in order to avoid naming conflicts when the files are saved. The default is NO.

CFPOP Query Variables
The following table describes the query variables that are returned by CFPOP. The example illustrates their use.

 CFPOP Query Variables  
Variable Names  Description  
queryname.RecordCount

 The total number of records returned by the query.  
queryname.CurrentRow

 The current row of the query being processed by CFOUTPUT.  
queryname.ColumnList

 The list of the column names in the query.  


Message Header and Body Columns
The following table lists the message header and body columns that are returned by CFPOP when you specify the ACTION attribute to be either GetHeaderOnly or GetAll. All of the columns are returned if you specify GetAll, but only header information is returned when you specify GetHeaderOnly.

 Message Header and Body Columns  
Column Name  GetHeaderOnly returns  GetAll returns  
queryname.date

 yes  yes  
queryname.from

 yes  yes  
queryname.messagenumber

 yes  yes  
queryname.replyto

 yes  yes  
queryname.subject

 yes  yes  
queryname.cc

 yes  yes  
queryname.to

 yes  yes  
queryname.body

 not available  yes  
queryname.header

 not available  yes  
queryname.attachments

 not available  yes  
queryname.attachmentfiles

 not available  yes  


Usage
To create a ColdFusion date/time object from the date-time string that is extracted from a mail message in the queryname.date column, use the following table to determine what to do.

 Date-Time Parsing According to Locale  
Locale  What to do?  
English (US) locale

 Use the ParseDateTime function and specify the POP attribute, which converts the date-time value to Greenwich Meantime.  
Other locales

 Extract the date portion of the string and pass it to the LSParseDateTime function, then add or subtract the conversion time, depending on the locale.  


See also the description of the SetLocale function.

For complete usage information on CFPOP, see Developing Web Applications with ColdFusion.

Example
<!--- This view-only example shows the use of CFPOP --->
<HTML>
<HEAD>
<TITLE>CFPOP Example</TITLE>
</HEAD>

<BODY>
<H3>CFPOP Example</H3>
<P>CFPOP allows you to retrieve and manipulate mail
in a POP3 mailbox.  This view-only example shows how to
create one feature of a mail client, allowing you to display
the mail headers in a POP3 mailbox.

<P>Simply uncomment this code and run with a mail-enabled CF Server to
see this feature in action.
<!---
<CFIF IsDefined("form.server ")>
<!--- make sure server, username are not empty --->
<CFIF form.server is not "" and form.username is not "">
     <CFPOP SERVER= "#server# " USERNAME=#UserName# PASSWORD=#pwd#
     ACTION= "GETHEADERONLY " NAME= "GetHeaders ">
     
     <H3>Message Headers in Your Inbox</H3>
     <P>Number of Records:
     <CFOUTPUT>#GetHeaders.RecordCount#</CFOUTPUT></P>
     <UL>
     <CFOUTPUT QUERY="GetHeaders">
         <LI>Row: #CurrentRow#:  From: #From# -- Subject: #Subject#
     </CFOUTPUT>
    </UL>
</CFIF>
</CFIF>

<FORM ACTION= "cfpop.cfm " METHOD= "POST ">
<P>Enter your mail server:
<P><INPUT TYPE= "Text " NAME= "server ">
<P>Enter your username:
<P><INPUT TYPE= "Text " NAME= "username ">
<P>Enter your password:
<P><INPUT TYPE= "password " NAME= "pwd ">
<INPUT TYPE= "Submit " NAME= "get message headers ">
</FORM>
--->

</BODY>
</HTML>      

0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

phillystyle123Author Commented:
anandkp - ok that works but how do i then use it to respond to emai?  do i use cfmail somehow????
0
anandkpCommented:
Use CFPOP to read thru ur mails on a POP server
& in case u wanna reply/forward them ... build ur own customised application using CFMAIL ...

I hope u r familiar with CFMAIL tag - if not let us know abt it !

K'Rgds
Anand
0
fixx17Commented:
Referring back to your first querstion.
"is it possible to receive email using cfmail. "

You can recieve mail with CFMAIL.

Just add yourself to the CC list in CFMAIL or the BCC list.

For instance

<cfmail to="form.emailbox" replyto="emailaddy@youremail.com" from="Whatever Name you want to add here." subject="add a subject here." bcc="youremail@addy.com"></cfmail>


Pending on how your CFADMIN is set up, you can add which SMTP server it gets sent out to.  In the Cfmail tags, just add
SERVER="smtp.yourisp.net"  or whatever it is.

IF you dont have one,  your CFADMINISTRATOR will send it to the deafault SMTP server.


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
Web Servers

From novice to tech pro — start learning today.

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.