Hi again.
I have been looking around on the net to try and find out how i can have an internal mailing system (privte mesaging) so that after my users have logged in the can send messages to the user's in their address book.
I hav a very very vague idea of how to do this, but if anybody has one on their site or knows of one or knows how to make one then help would be greatly acepted :d
Thanks
Eric
Internal Email System (PM)
Moderator: General Moderators
- ericburnard
- Forum Contributor
- Posts: 104
- Joined: Wed Jun 15, 2005 5:11 pm
- Location: Chesterfield, UK
Private Messaging like the way its done here (devnet forums) and other forums etc dont use mail features - it just sends the msg internally stored in the database to the recipient's Inbox (marked in the table) - This is totally within a single server.
Mail on the other hand is sent through Ports to any server in the world.
Mail on the other hand is sent through Ports to any server in the world.
- ericburnard
- Forum Contributor
- Posts: 104
- Joined: Wed Jun 15, 2005 5:11 pm
- Location: Chesterfield, UK
Hi,
I put together a pm system a little while ago, like anjanesh said, the data is just inserted in to a db.
I assume you have a membership system .. If so just create a form with fields
to:, subject:, message.
post that data to a sql INSERT query:
I create 2 querys, one is the data for the senders "sent items" and the other for the recievers inbox.
Other fields were added as yu can see above so you can query the table for the correct data.
user_name so you can query WHERE user_name = '$user_name'
new: query whether it is new mail.
sent: to query and show the pm message in the senders sent items.
date: using now() to insert date & time so it can be called on to show dates pm messages were sent.
Then you create your other pages (querys) toi grab the inbox data, send data, and also add your delete etc etc functions.
I created 4 pages:
inbox.php = lists inbox pm messages
sent.php = same as inbox.php but lists sent pm messages
read.php = shows the pm message for reading (with reply and quote reply) links
pm_parse.php = All my functions (querys) to run the pm system.
SQL Dump I used:
Im not a very good explainer, but there is some food for thought, should be enough to give u the basic concept ..
hth
I put together a pm system a little while ago, like anjanesh said, the data is just inserted in to a db.
I assume you have a membership system .. If so just create a form with fields
to:, subject:, message.
post that data to a sql INSERT query:
Code: Select all
$sql = mysql_query("INSERT INTO pm (user_name, subject, message, sender, sent, new, date)
VALUES('$user_name', '$subject', '$message', '$sender', '1', '1', now())") or die (mysql_error());
$sql = mysql_query("INSERT INTO pm (user_name, subject, message, sender, sent, date)
VALUES('$user_name', '$subject', '$message', '$sender', '0', now())") or die (mysql_error());Other fields were added as yu can see above so you can query the table for the correct data.
user_name so you can query WHERE user_name = '$user_name'
new: query whether it is new mail.
sent: to query and show the pm message in the senders sent items.
date: using now() to insert date & time so it can be called on to show dates pm messages were sent.
Then you create your other pages (querys) toi grab the inbox data, send data, and also add your delete etc etc functions.
I created 4 pages:
inbox.php = lists inbox pm messages
sent.php = same as inbox.php but lists sent pm messages
read.php = shows the pm message for reading (with reply and quote reply) links
pm_parse.php = All my functions (querys) to run the pm system.
SQL Dump I used:
Code: Select all
CREATE TABLE pm
(
id int(6) NOT NULL auto_increment,
user_name varchar(255) NOT NULL,
subject varchar(255) NOT NULL,
message varchar(255) NOT NULL,
sender varchar(255) NOT NULL,
sent varchar(255) NOT NULL,
new varchar(255) NOT NULL,
date datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (id)
) TYPE=MyISAM;hth
- ericburnard
- Forum Contributor
- Posts: 104
- Joined: Wed Jun 15, 2005 5:11 pm
- Location: Chesterfield, UK