-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMailCheck.cfc
90 lines (66 loc) · 3.06 KB
/
MailCheck.cfc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!--- 1.0 Dev 1 --->
<!--- Last Updated: 2011-01-21 --->
<!--- Created by Steve Bryant 2011-01-21 --->
<cfcomponent displayname="Mailer" hint="I handle sending of email notices. The advantage of using Mailer instead of cfmail is that I can be instantiated with information and then passed as an object to a component that sends email, circumventing the need to pass a bunch of email-related information to each component that sends email.">
<cffunction name="init" access="public" returntype="any" output="no" hint="I instantiate and return this object.">
<cfargument name="MailServer" type="string" default="">
<cfargument name="username" type="string" default="">
<cfargument name="password" type="string" default="">
<!---<cfargument name="mode" type="string" required="false">--->
<cfset variables.MailServer = arguments.MailServer>
<cfset variables.username = arguments.username>
<cfset variables.password = arguments.password>
<!---<cfif NOT Len(arguments.MailServer)>
<cfset arguments.mode = "Sim">
</cfif>
<cfif NOT StructKeyExists(arguments,"mode")>
<cfif getMetaData(this).name CONTAINS "Sim">
<cfset arguments.mode = "Sim">
<cfelse>
<cfset arguments.mode = "Live">
</cfif>
</cfif>
<cfset setMode(arguments.mode)>--->
<cfreturn This>
</cffunction>
<cffunction name="deleteMessage" access="public" returntype="void" output="no">
<cfargument name="uid" type="string" required="yes">
<cfpop
server="#variables.MailServer#"
username="#variables.username#"
password="#variables.password#"
action="delete"
uid="#Trim(arguments.uid)#"
>
</cffunction>
<cffunction name="getAll" access="public" returntype="query" output="no">
<cfargument name="uid" type="string" required="no">
<cfset arguments.action = "getAll">
<cfreturn getMessages(argumentCollection=arguments)>
</cffunction>
<cffunction name="getHeaderOnly" access="public" returntype="query" output="no">
<cfargument name="uid" type="string" required="no">
<cfset arguments.action = "getHeaderOnly">
<cfreturn getMessages(argumentCollection=arguments)>
</cffunction>
<cffunction name="getMessages" access="public" returntype="query" output="no">
<cfargument name="action" type="string" default="getAll">
<cfargument name="uid" type="string" required="no">
<cfset var qMessages = 0>
<cfif StructKeyExists(arguments,"uid")>
<cfpop name="qMessages" server="#variables.MailServer#" username="#variables.username#" password="#variables.password#" action="#arguments.action#" attachmentPath="mail/" uid="#arguments.uid#">
<cfelse>
<cfpop name="qMessages" server="#variables.MailServer#" username="#variables.username#" password="#variables.password#" action="#arguments.action#" attachmentPath="mail/">
</cfif>
<cfreturn qMessages>
</cffunction>
<!---<cffunction name="setMode" access="public" returntype="void" output="no">
<cfargument name="mode" type="string" required="yes">
<cfset var SimModes = "Sim,Dev">
<cfif ListFindNoCase(SimModes,arguments.mode)>
<cfset variables.mode = "Sim">
<cfelse>
<cfset variables.mode = "Live">
</cfif>
</cffunction>--->
</cfcomponent>