Hello.
I have to write a short c program for sending an email. I had no problem until I realized I also have to attach a file to the email I'm sending. Is it possible, using the "sendmail" command?
Here's what the code looks like so far:
Code:
fp = popen ("sendmail -t", "w");
if (fp==NULL)
{
printf("Error opening pipe\n");
exit(0);
}/*if*/
fwrite(text_message, 1, strlen(text_message), fp);
pclose(fp);
where text_message is the message I'm sending, including To, Cc, Bcc and Subject line.
So... how can I attach a file to the message?
Thanks a lot for your help.
Chris