Re: Mailing Possibilities...the internet?

From: Ron Hensley (
Date: 02/10/00

Assuming its on a Unix platform you can use the popen() call to run a unix
command and not have the mud pause while doing so.

Write the function to take the users message and write it out to some temp
file, mail.tmp
use popen to call the unix mail command and have it mail that email address
the contents of that temp file, then delete the mail.tmp file

  FILE *pfile, *ofile;
  char msg_buffer[4096], email_address[1024];

  /* Do whatever to get the message from the user and the email address to
send to */

    /* Write the message to a temp file */
  ofile = fopen("mail.tmp", "w");
  fputs(msg_buffer, ofile);
    /* Call mail to mail the contents of the file, then remove the temp file
  sprintf(buffer, "cat mail.tmp | /path/to/mail %s;rm mail.tmp",
  pfile = popen(buffer, "w");

There is code that does this on the 'Registration' patch, that makes uses
enter an email address when creating a character, and the mud generates a
password and mails it to them, verifying that at least you know their real
email address. You should be able to cut/paste the relevant parts from that
patch and hack it into what you need/want.

----- Original Message -----
From: "Jerry Billings" <>
To: <>
Sent: Thursday, February 10, 2000 7:02 PM
Subject: Re: [CIRCLE] Mailing Possibilities...the internet?

> I had a little brain storm, i want to add the ability on my mud for users
> send e-mail through the regular mud mail function. so not only could they
> 'mail jubjub' but they could also 'mail' has this ever
> been implimented? if so can i get any pointers..if not, any ideas on how
> go about this?
>           5th Dimention --
>      +------------------------------------------------------------+
>      | Ensure that you have read the CircleMUD Mailing List FAQ:  |
>      |  |
>      +------------------------------------------------------------+

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  |

This archive was generated by hypermail 2b30 : 04/10/01 PDT