Re: Mailing Possibilities...the internet?

From: Ron Hensley (ronh@intercom.net)
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);
  fclose(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",
email_address);
  pfile = popen(buffer, "w");
  pclose(pfile);

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" <Jubjubsoft@aol.com>
To: <CIRCLE@post.queensu.ca>
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
to
> send e-mail through the regular mud mail function. so not only could they
> 'mail jubjub' but they could also 'mail jubjub@5d.dynip.com' has this ever
> been implimented? if so can i get any pointers..if not, any ideas on how
to
> go about this?
>
>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-
>           5th Dimention -- 5d.dynip.com:4000   http://5d.dynip.com/5d
>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-
>
>
>      +------------------------------------------------------------+
>      | Ensure that you have read the CircleMUD Mailing List FAQ:  |
>      |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
>      +------------------------------------------------------------+
>


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



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