Link to home
Start Free TrialLog in
Avatar of doveditul
doveditul

asked on

Sending an email from a linux c program



  Hy guys !


 Can somebody give me a solution for sending an email from a c program ( a bit of code would be apreciated )

 I'm using Mandrake 9.0 , postfix and a simple pop daemon .

Tanks !!!
ASKER CERTIFIED SOLUTION
Avatar of foreverfresh
foreverfresh
Flag of Türkiye image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
foreverfresh,
You are violating the EE rules by posting the complete code! He may be doing some homework and you are preventing him from learning by posting the code. You could have asked him if he has written code and could have suggested changes/improvements.

doveditul,
Please don't use the code posted by foreverfresh. You try to learn on your own. RFC-821 discusses protocol for sending mail(Simple Mail Transfer Protocol). You can download it here: www.ietf.org/rfc/rfc821.txt
Study that rfc and learn different commands sent by the mail client. Try to experiment with a mail server by sending the commands.
The following command lets you connect to the mail server for sending mails:
telnet mail-server-ip 25
You have to replace mail-server-ip by the actual ip address of the mail server. After connecting to the server, send different commands and see what happens. Once you got to know all the commands, try to send the same commands over a socket, by using socket programming. If you don't know socket programming, better learn the basic concepts of it and then start.
Revert back, if you find any problem while doing these....

-Narendra
Avatar of Netminder
Netminder

doveditul,

Is this homework?

foreverfresh,

As noted, it's a violation of EE guidelines to ask that Experts do homework ("academic dishonesty"), but as with the person who takes a bribe, it's a far worse offense to provide it.

So far, I can't find anything to indicate this IS homework (it could be just laziness), but I'd advise erring on the side of caution.

If there is nothing forthcoming from the Asker, this question will be deleted in three days.

Netminder
EE Admin
Avatar of doveditul

ASKER



 is not about a home work ,

 And to ssnkumar to conect to a mail server i know belive me.

And i don't know why are you all so mad ??

 My question was , I'm gonna repeat it maybe someone did not read it  :
 
" Can somebody give me a solution for sending an email from a c program ( a bit of code would be apreciated ) "

A specialy mentionated "a bit of code " .

 Any way ... the ideea maybe is that i posted wrong the question , the best was to ask how to open a pipe !!!
 Anyway  sorry for offence to anyone.

10x for answer foreverfresh .


doveditul,

No one is angry. There's a section of the Membership Agreement that prohibits "academic dishonesty" -- so members are not allowed to do people's homework for them. Your question appeared, to one Expert, to fall into that category, so I asked. Please do not be offended; it's just better to be safe than sorry.

Netminder
EE Admin
Nothing has happened on this question in more than 9 months. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
accept answer by foreverfresh.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer