Help needed working with MAILBOXES in C (source included) 
Author Message
 Help needed working with MAILBOXES in C (source included)


    I was wondering if anyone could give me some help with the program
    I have included below.  Please note this is my FIRST attempt to work with
    mailboxes and RTL routines (as most of you will probably notice &8) !) .
    The program is supposed to create two mailboxes assign logicals to them
    and send me a mail message displaying the logicals and the mailboxes
    associated with them.  All the program currently does is :

$ run post
New mail on node UBVMS from UBVMS::V064QPFU
$ mail
You have 1 new message.
   1 UBVMS::V064QPFU    14-MAR-1993  TEST

MAIL> ex

$ show log/table=lnm$job *mail


  "INMAIL" = "MBA9533:"                                                    

My questions are as follows :

1.) What is happening to OUTMAIL and how can I correct the code to
    assign it correctly ?

2.) How can I modify the code to mail me a subject of :


    rather than TEST (which I now have in there temporarily) so that I can
    see that the logicals were assigned properly ?  

Any pointers on what I am doing wrong, explanations as to why I'm doing it
wrong and some examples of how to do it right would be greatly appreciated !!!

                                      Thanks in advance,


                                     SUNYnet  : ubvms::v064qpfu

I'm on a VAX 6520 VMS version 5.5-1 in case anyone is wondering about my

------------------------------- Cut Here --------------------------------------

#include <stdio.h>
#include <descrip.h>
#include <string.h>

#define WHAT "TEST "   /* Temporarily placed in as a subject */


{ /* Beginning of main function */

int length ;
unsigned  inchannel, outchannel,indev,outdev ;  /* Not sure if these are
                                                   defined properly      */

char user[10] = "V064QPFU" ;

char command_text[80] = "MAIL/NOSELF NL: /SUBJECT= " ;

$DESCRIPTOR(command,command_text) ;

$DESCRIPTOR(OUTBOX,"OUTMAIL") ;      /* Should this be a descriptor ? */

SYS$CREMBX(NULL,&inchannel, &132,&1000,&0,NULL,&INBOX) ;
SYS$CREMBX(NULL,&outchannel,&132,&1000,&0,NULL,&OUTBOX) ;

LIB$SYS_TRNLOG(&INBOX,&length,&indev) ;
LIB$SYS_TRNLOG(&OUTBOX,&length,&outdev) ;

strcat(command_text,"TEST") ;          /* Couldn't figure out how to get the */
strcat(command_text," ") ;             /* info I needed into the subject     */
strcat(command_text,user) ;

 sleep(5) ;  


} /* Ending of main function */

Fri, 01 Sep 1995 00:53:00 GMT  
 Help needed working with MAILBOXES in C (source included)
This has NOTHING to do with C. It is a VAX/VMS specific question.
Repost it in comp.os.vms & you will probably get some better answers than mine.
You are spawning the MAIL command, with its input from a mailbox.
NB: A VMS "mailbox" has nothing (inherently) to do with "mail" messages.
It is just one of several methods of interprocess communication (like named pipe).
Your program never sends any input through the mailbox to the MAIL child task.
If it is possible at all, you need to write your input into the mailbox so that
MAIL receives it on its redirected sys$input.
I have not tried this approach. It may be simpler for you to create an ASCII
file containing your message etc & spawn MAIL with input from the ASCII file.

Fri, 01 Sep 1995 09:24:34 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Need help with this UUDecoder (Source Included)

2. gets() and fgets() Not Working Properly - Source Included

3. newbe/cs student, need help w/ code

4. include source needed for <wait.h>

5. Need some simple advice -- ODBC Database Source Code included

6. Include code in other Cs files

7. include another form(cs) in C#?

8. source for included included files

9. Compile CS source code using ICodeCompiler

10. cs source code

11. Need working qsort source code

12. Source Included !!! Please Help


Powered by phpBB® Forum Software