Re: [code] Any ideas ?

From: Rasmus 'Con' Ronlev (raro94ab@hp4.econ.cbs.dk)
Date: 10/02/96


On Sat, 28 Sep 1996, Ebon Mists wrote:

>I am going to make my mud send an email to a user based on certian events,
>Real e-mail, not mudmail. The first and probably worst method I thought of
>was writing the email to a text file from within the mud, then system()'ing
>a sendmail command. That's probably really slow and clunky and a dumbass way
>to do it. Does anyone out there have any ideas as to a better method?

Well, when using the system() call, you might hit some sort of 'delay'
in terms, that the execution of the command might take some time. Thus
what you 'want' to do, is to create some sort of way to handle messages,
that won't slow down the mud. An idea would be to write your e-mail, and
the adresss of the person to recive the mail into a file, for example
lib/tmp/email.x , where x would be a number. Then you could use a 'loop'
open file thing, to write the e-mail message and the receiver in to the
first available 'file' and thus only ysing time for looping through
available files, and writing the file. I THINK that it won't lag, at least
not too much. Then have a crontab script run with some interval, that
reads there messages, and posts the mails :)

Makes any sense ?? :O

Regards,
Con

d.
--
     Rasmus Rønlev DOEK'94      WWW: http://www.econ.cbs.dk/people/raro94ab
     Student instructor         MUD: exiled.mud.circlemud.org 5000
                                         199.199.16.100 5000
       Student, B.Sc in Computer Science and Business Administration.


+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/18/00 PST