[Package Index | Mudlib Index | Effect Index]

File /obj/handlers/mailer.c

The mailer handler object. This is used to send mail and do oyther stuff related to mail. The new mailer object ! *shiver* Thanks to Wodan and Pinkfish for ideas and help. By Turrican@Discworld, May 1995.

Written by Turrican

Started May 1995

Includes

This class includes the following files /include/player_handler.h, /include/mail.h, /include/localtime.h and /include/mime.h

Method index

Public Functions

These are functions that everyone can access.

do_mail_message
varargs int do_mail_message(string t,
                            string from,
                            string sub,
                            string ccs,
                            string body,
                             int,
                            string only_to,
                            int flag)

This method allows a message to be mailed. It checks the previous object to make sure it is one of the allowed set to do mailing.

Parameters:
t - who it is to
from - who it is from
sub - the subject of the message
ccs - the carbon copy recipients
body - the body of the message
only_to - only mail to the to address
flag - prevent this_player() from getting the messages if flag != 0

Example:
MAIL_HANDLER->do_mail_message("pinkfish", "gumboot, killer tomato":,
                              "About the tomatoes", "",
                  "The grass ius greener yesterday,.\nYours\nGumboot.");

finger_mail
string finger_mail(string pname)

This method returns the mail information which is placed into the the finger command.

Parameters:
pname - the name of the player

Returns:
the function mail string


folder_filename
string folder_filename(string name)
format_date
string format_date(int x)

This formats the date as needed by the mailer object.

Parameters:
x - the date to format

Returns:
the new date


new_mail
string new_mail(string pname)

This method returns a string saying if the player has new mail or not. This is what is used when the player first logs on.

Parameters:
pname - the name of the player

Returns:
the new mail string

Example:
str = MAIL_HANDLER->new_mail(this_player()->query_name());

query_do_this_last
mixed * query_do_this_last()

This method returns the call back fuinction to use when the mailer has finished. ({ ob, func })

Returns:
the call back function


query_folders
string * query_folders(string pname)

This method returns the list of folders associated with the player.

Parameters:
pname - the player name

Returns:
an array containing the folder names


read_mail
void read_mail(string str,
               string sub)

This method is the main entry point to the mailer. It is what is called to start up the system when a mailer is used.

Example:
mailer = clone_object(MAIL_HANDLER);
mailer->read_mail();

set_do_this_last
void set_do_this_last(mixed * bing)

This method sets the call back fuinction to use when the mailer has finished. ({ ob, func })

Parameters:
bing - the call back function