Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

C program using mailx

  • 24-12-2005 8:37pm
    #1
    Closed Accounts Posts: 232 ✭✭


    Hi,
    I want to write a C program that sends an e-mail message from a Unix computer. In the past I have been able to do it as I have just written "mailx -s \"Subject\" someone@somewhere.com < message.txt" to buf, and then system(buf); would send the e-mail (message already written to message.txt). But now there are variables in the message, so I want the message copied to buf also (ie. message is not already written in a text file), but I can't work out how to do it... everything I have tried so far, mailx has either treated each word as another e-mail address, or mailx has sent an e-mail with no message, and then the system has tried to run each of the words in the message as a command. How do I do it?

    Thanks, and Happy Christmas!


Comments

  • Registered Users, Registered Users 2 Posts: 1,865 ✭✭✭Syth


    Could you not write the email to the file buffer.txt and then do what you just did?


Advertisement