forked from cloudControl/CloudMailInAddonUsage
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.php
81 lines (81 loc) · 3.15 KB
/
index.php
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
<!DOCTYPE unspecified PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head></head>
<body>
<h1>CloudmailIn for cloudControl</h1>
<div style="width: 600px;">
<p>
This mini app on <a href="http://www.cloudcontrol.com"
target="_blank">cloudControl</a>
shows the usage of the CloudMailIn addon.
</p>
<p>
<a href="http://cloudmailin.com" target="_blank">The
CloudMailIn addon</a> provides incoming email for your app.
</p>
<p>
The mini app's goal is - <span style="font-weight: bold;">in this case</span> - to store the incoming
messages to a database. <br/>
For your special needs overwrite th handleMail function in "incomingMail.php". <br/>
</p>
<p>
To run the app you need a cloudControl MySQLs
addon and naturally a cloudControl CloudMailIn addon.
</p>
<p>
To run this app you have to
<ul>
<li>
configure the endpoint of incoming emails to CloudMailIn.com.
<ul>
<li>
Login on CloudMailIn.com with your
CloudMailIn credentials (type in commandline <code>$ cctrlapp
APP_NAME/DEP_NAME addon</code>)
</li>
<li>
On CloudMailIn's dashboard at "Email Forwards
(SMTP)", choose the proper CloudMailIn email address and click on
"manage".
Click on "Edit Target" and fill the target
field with "http://APP_NAME.cloudcontrolled.com/incomingMail.php"
</li>
</ul>
</li>
<li>
Configure your database. Connect to your
database with your mysqls credentials
(type in commandline <code>$ cctrlapp
APP_NAME/DEP_NAME addon</code>) <br/>
Create a table in your database:
<pre>
CREATE TABLE `mail` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE
CURRENT_TIMESTAMP,
`from` varchar(255) DEFAULT '',
`to` varchar(255) DEFAULT '',
`subject` varchar(255) DEFAULT '',
`plain` varchar(2048) DEFAULT '',
`html` varchar(4096) DEFAULT '',
`x_remote_ip` varchar(128) DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
</pre>
</li>
<li>
Now you can send an e-mail to the CloudMailIn
email address from your default e-mail client.
CloudMailIn forwards the e-mail to your
webapp. The incomingMail.php script stores the mail to the MySQLs database.
</li>
<li>
You can read the mail with a request to
"http://APP_NAME.cloudcontrolled.com/readMail.php"
</li>
</ul>
</p>
</div>
</body>
</html>