LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-18-2005, 12:27 PM   #1
KeitgB
LQ Newbie
 
Registered: Jul 2005
Posts: 1

Rep: Reputation: 0
Sending email from within a C program


Is there an API available to send email from within a C program on Linux?
 
Old 07-18-2005, 02:07 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
One possibility:

system ("echo SOME STUFF | mail -s 'MY SUBJECT' SOMEBODY@somewhere.com");
 
Old 07-18-2005, 04:04 PM   #3
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
you can also use a popen with sendmail


this works just like working with files on the harddrive

Code:
FILE *command; 

command = popen ( "ps -A"."r");


this code would put the output of ps -A into the stream command that you could parse with sscanf or some other function to get the data or work with it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sending email cambie Linux - Software 1 11-20-2004 06:02 PM
sending email to an ip pyu7 Linux - Software 4 10-08-2004 02:46 PM
sending email GraemeK Linux - Networking 1 08-24-2003 05:14 PM
sending email csDraco_ Slackware 5 08-22-2003 05:50 PM
sending an email to a email address after a perl operation meluser Programming 9 04-07-2003 01:26 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration