Sending an email in C program

This is a discussion on Sending an email in C program within the C Programming forums, part of the General Programming Boards category; Originally Posted by Chirag Kenny, Yes I am well aware about Operating System, and i'm not trying to debate here...i ...

  1. #16
    The C eater *munch*
    Join Date
    Oct 2006
    Posts
    101
    Quote Originally Posted by Chirag
    Kenny, Yes I am well aware about Operating System, and i'm not trying to debate here...i just posted my point of view, maybe i am not correct or perhaps as good as you guys, but I am here to LEARN and to DISCUSS. I am not a pro.

    Prelude, I think that C program will not be as interactive Cause it uses DOS. If you like keep the program LOADED and like a scheduled task or something and not intend to work in FOREGROUND but on BACKGROUND...then according to me C is a bad choice. But different people have different opinion, i just gave mine...maybe i could be wrong, am willing to hear your point to it.

    Thank you
    Chirag Chhatbar
    I don't know, but I find my OS to be VERY interactive...
    Everyone here has the intention of giving them their idea... If you find their way of expressing their thought a bit offending... then I'd say, welcome to the real world...

    You want idea, you want to discuss stuff? then prepare to find comments that don't fit your way of saying things

    * like mine *

    Peace,

    -A
    Last edited by yxunomei; 10-18-2006 at 06:20 AM.

  2. #17
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >Prelude, I think that C program will not be as interactive Cause it uses DOS.
    I think you mean command line applications. In that case, you've only scratched the surface of what C can do. For example, most of the code I write doesn't even have a user interface except in the testing framework.

    >If you like keep the program LOADED and like a scheduled task or something
    >and not intend to work in FOREGROUND but on BACKGROUND...then according to me C is a bad choice.
    Actually, C is a better choice for things like device drivers and daemons that run independently and completely in the background than for talking to the user. C is also a good choice for back-end processing where a user interface defers to a C component for the grunt work. A user interface ends up doing a lot of string processing, which C is notoriously bad at.
    My best code is written with the delete key.

  3. #18
    Registered User Chirag's Avatar
    Join Date
    Oct 2006
    Location
    India
    Posts
    6
    But we are not making any kind of drivers or daemons, we are acutally preparing a program that sends Emails. Don't you think it would be better to implement language, such as JAVA? Cause you are not entirely gonna work on background, wouldn't u like to provide the facility to customization of time or No. of emails to be sent, destination address and so on. In future you may need to edit the database. Do you feel it would be done very well and easily with C? and that you can make its GUI impressive?

  4. #19
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Location
    Alabama
    Posts
    1,065
    Quote Originally Posted by Chirag
    But we are not making any kind of drivers or daemons, we are acutally preparing a program that sends Emails. Don't you think it would be better to implement language, such as JAVA? Cause you are not entirely gonna work on background, wouldn't u like to provide the facility to customization of time or No. of emails to be sent, destination address and so on. In future you may need to edit the database. Do you feel it would be done very well and easily with C? and that you can make its GUI impressive?
    Yes, I do believe that one can make a wonderful GUI using C. There are these things called Libraries and APIs that make creating a graphical user interface not so difficult.

  5. #20
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >But we are not making any kind of drivers or daemons, we are acutally preparing a program that sends Emails.
    On the contrary, the program requirements suggest a daemon. To save you some scrolling, here's the original description:
    I want to write a program that checks for the time(date) and when it reaches
    the specified date, it sends an email (written and stored before) directly
    every month.
    The message has already been saved, so there's no user interaction at all. Since it makes sense to let users choose the interval, a front-end can be written to talk with the program (ie. stop it, then start it again with a new interval), or a simple configuration file can be used. This is perfectly suited to a daemon (or service if you like Windows lingo). In fact, if you didn't write it as one, I would question the quality of your design.

    >Don't you think it would be better to implement language, such as JAVA?
    No, I think it would be better to use Perl and whatever OS feature allows for task scheduling. But if you want to write the whole thing rather than rely on convenient features, I would still prefer C in Unix, or C# in Windows (both due to the ease of creating daemons with minimal thought). Java doesn't even enter the equation.

    >Cause you are not entirely gonna work on background, wouldn't u like to provide the facility
    >to customization of time or No. of emails to be sent, destination address and so on.
    Customization of the time is good, but that makes more sense as an initial configuration or a run-time pull from a file, not a run-time push from the user. Everything else is pointless because the email has already been saved with that information. The program does nothing but actually send it. Because the email has already been stored, the best way to determine the number of emails to send is to simply pull all emails from a specific directory.

    >In future you may need to edit the database.
    Now we're using a database? Hmm, I think you're over-engineering this program.

    >Do you feel it would be done very well and easily with C?
    I don't see why not. It's a very simple program.

    >and that you can make its GUI impressive?
    I don't see the need for a GUI. Perhaps if you want to give users a graphical configuration tool that talks to the program or hides the editing of a configuration file that the program reads from, but that's a different application entirely. But yes, it's just as possible to write a pretty interface in C as it is in Java.
    My best code is written with the delete key.

  6. #21
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Quote Originally Posted by Prelude
    Java doesn't even enter the equation.
    Actually, the Apache project has a library that lets you write daemons/services in Java. It even is cross-platform, i.e. your write the code and it will be a daemon in *nix and a service in Windows.
    Tomcat uses it for example.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  7. #22
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    Yeah, for a cross-platform GUI I think Java is nice. If it is for a single target platform, then C/C++ can create as nice or better of a GUI.
    You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.

  8. #23
    and Nothing Else Matters
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    117
    wow! is C really that powerful?? i kinda thought that C was only famous coz linux was written on it. hmmm... now i know there are lotsa other reasons too!
    It is not who I am inside but what I do that defines me.

  9. #24
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Short version: with the exception of a few special domains, if it can be done at all, then it can be done in C.

    It might just be a lot more work in C than in other languages.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  10. #25
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Location
    Alabama
    Posts
    1,065
    Quote Originally Posted by CornedBee
    It might just be a lot more work in C than in other languages.
    Other languages probably have a lib written in C to handle the "lot more work".

  11. #26
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    I think the "lot more work" is worth it and it doesn't seem that you have some kind of a deadline, so learn a bit GUI programming and then start trying
    "The Internet treats censorship as damage and routes around it." - John Gilmore

  12. #27
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Quote Originally Posted by Kennedy
    Other languages probably have a lib written in C to handle the "lot more work".
    True. So other people already did the "lot more work". That's nice sometimes
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  13. #28
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Location
    Alabama
    Posts
    1,065
    Quote Originally Posted by CornedBee
    True. So other people already did the "lot more work". That's nice sometimes
    Yes, but my point was that it is still written in C. I still don't get where someone could say that C "can't do" something. . . Almost like saying it couldn't be done in Assembly.

  14. #29
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,434
    Some time ago, this thread has a point, and then lost it.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C code for Sending Email with attachment
    By Mr coder in forum C Programming
    Replies: 5
    Last Post: 03-06-2009, 07:15 AM
  2. sending an email through a C program
    By shoobsie in forum C Programming
    Replies: 2
    Last Post: 10-06-2005, 06:10 AM
  3. sending email
    By hiya in forum Networking/Device Communication
    Replies: 11
    Last Post: 08-06-2005, 03:05 AM
  4. I need some help with my program please.
    By agentxx04 in forum C Programming
    Replies: 9
    Last Post: 09-26-2004, 07:51 AM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21