Problem in using elm to send the attached file using system() call in C program

Problem in using elm to send the attached file using system() call in C program

Post by Sapn » Sat, 14 Sep 2002 13:55:21



Hello
       I have written a simple C program for sending mails using elm
facility using system() function call.The program is compiling
successfully but while running it gives the error for recipient as
shown below.The command for the elm which is specified here in
system() call is running successfully if specified from the command
line.And also the program is running successfully if the attached
file(bill.txt) is not specified.

/* simple c program to use elm facility to send the attached file */
#include<stdio.h>
#include<stdlib.h>

main()
{
        int a;


        printf("\n The a is %d",a);

Quote:}

And the program's output is as follow-



Must specify a recipient in batch mode.
The a is 256

Now what is this batch mode ??
-Sapna

 
 
 

Problem in using elm to send the attached file using system() call in C program

Post by Allen McInto » Sat, 14 Sep 2002 22:53:12


To understand what is going on, run this:

cat >bar <<'!'

!
chmod +x bar
cat >foo.c <<'!'
/* simple c program to use elm facility to send the attached file */
#include<stdio.h>
#include<stdlib.h>

int
main()
{
        int a, b;



        printf("\na is %d and b is %d\n",a, b);
        return 0;

Quote:}

!
gcc -o foo foo.c
./foo

 
 
 

1. Compare file modification date using tcsh built-ins

Is there any straightforward way to compare file modification dates
(i.e. which is older/newer) using tcsh built-ins?  I know ksh has the
"file1-nt" file2 and "file1-ot file2" operators for boolean expressions,
but I can't seem to find any relatively simple way of performing the
same comparision in tcsh, other than using sed/awk to extract the two
files' date fields from their "ls -l" listings and attempting to
lexographically compare two strings.

Thanks.
Ben West

Sent via Deja.com http://www.deja.com/
Before you buy.

2. Laptop printing with Apple LaserWriter II NTX??

3. Stabbed US preacher flees INDIA state (The same INS tactics used against the stabbed preacher)

4. setting up AMD pcnet NIC?

5. Plug-Ins using C++

6. grep

7. Need help writing C program using UNIX system calls (read, write, etc) that copies files

8. is there a 2GB size limit on a file on NFS fielsystem on linux?

9. how send an attached file using mailx ?

10. Security from outside call-ins

11. pppd dial ins and , "LCP: timeout sending Config-Requests"

12. Question on writing c program implement cp function using UNIX system calls - read, write, etc.

13. Using system() call in a CGI C program