LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-25-2004, 08:16 AM   #1
lucasbl3
LQ Newbie
 
Registered: Feb 2004
Posts: 8

Rep: Reputation: 0
Need to send email via C


Hello!
I would appreciate any help in this matter. I need to make a function that, receiving a destination address, subject and body, sends an email.
It seems one of the possibilities is invoking, using the popen function, the mail client and then passing to it all the necessary components, which is making some troubles.
Is there a "cleaner" way of accomplishing this, like accessing some fuction from some api or anything like that?

Thanks a lot!
 
Old 02-25-2004, 08:48 AM   #2
lone_nut
Member
 
Registered: Dec 2003
Location: Denmark
Distribution: Mandrake
Posts: 179

Rep: Reputation: 30
Well I don't know if there is any libary that allows you to send mail from c. But you could code your own. If you have never done any network programming before, i suggest you try to look at Beejs network programming guide it is very good.
 
Old 02-25-2004, 10:59 AM   #3
itsme86
Senior Member
 
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 59
You might want to just use the system() function to run the 'mail' command. It would be a whole lot easier
 
Old 02-25-2004, 11:04 AM   #4
itsme86
Senior Member
 
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 59
But if you're really interested in writing your own, here's a plugin that I wrote for TinyMAZE to allow sending e-mail from within the game. You'll probably have to play with the code at least a little bit. It does non-blocking I/O and such in its current form and is designed to work within TinyMAZE's plugin construct.

http://www.tinymaze.com/email.c
 
  


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
email 'send' NO - email 'receive' YES..? captain skywave Linux - Wireless Networking 4 04-23-2005 03:35 AM
email 'send' YES - email 'receive' NO..? captain skywave Linux - Wireless Networking 1 04-22-2005 05:23 AM
Can't send email... distortedstar Linux - Software 3 03-25-2004 08:54 PM
Allowing an IP to send email using my email server... culprit Linux - Networking 7 09-09-2003 12:24 PM
Need to send email linuxRules Linux - General 4 07-12-2002 01:57 PM

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

All times are GMT -5. The time now is 11:55 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