Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Friends.

I am working on a project in C Language. I have a file students.txt in my D: Partition. This file is updated after each 12 hours. I want to e-mail this file after each update to a particular email address.
[Email address removed]

Please tell me that how can I do this?

Note: I am not talking about Visual C++ or C#.
Posted
Updated 3-Aug-10 20:31pm
v2
Comments
Sandeep Mewara 4-Aug-10 2:31am    
Avoid providing any emails in your question unless you like SPAM.

On Windows you may use MAPI [^]. You may find a lot of articles about, here at CodeProject [^].
:)
 
Share this answer
 
It's fairly (compared with something tricky like HTTP) easy to write an SMTP client - it's a simple text based protocol so you can even experiment with it via telnet if you feel perverse enough.

I believe libcurl[^] also supports SMTP but I've not used it for anything but HTTP. That might help shield you from the problems of implementing an SMTP client yourself.

Cheers,

Ash
 
Share this answer
 
I don't believe MFC has any support for email. I am certain that C has zero support for anything like that. You'll have to look for a library you can use, you'll probably need to pay for it.
 
Share this answer
 
Comments
rashidfarooq 4-Aug-10 3:32am    
If it is possible with some libraries, then which are those libraries?
in mfc ,JMail ? SMTP ? Good use in many cases
 
Share this answer
 
You mentioned that the file gets updated after 12 hours. Well who updates the file? Does your application (C) has anything to do with the update? Do you get notified when the file gets updated?

You may want to think outside of your application. Is sending the email outside your application acceptable? If so, you can slap some windows scripts to send an email file. You can schedule to run the job every 12 hours. For that matter the job could check for something (say file update) before sending the email.
 
Share this answer
 
Comments
rashidfarooq 5-Aug-10 1:09am    
Brother, My C Program update the file after each 12 hours. And As you said that Is sending the email outside your application acceptable?
The Answer of this application is yes. If some of the windows script can send this file to any mail address after a specific time, Then Plz Guide me about that.
Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900