Help

This is a discussion on Help within the A Brief History of Cprogramming.com forums, part of the Community Boards category; I have made a Dos program in c++... regular dos. not true dos.. And in that program i am asking ...

  1. #1
    Registered User Help!'s Avatar
    Join Date
    Jan 2003
    Posts
    20

    Help

    I have made a Dos program in c++... regular dos. not true dos..
    And in that program i am asking a cpl of questions, and i would like to know how to do so. When they questions are answered, all the facts are sent to my e-mail. someone help me with that plz.


    BTW: hammer, i had to do that thread bumping, cos i had a black dot over the letter symbol sometimes <---, and when i tryed to watch the new replies, i had to write something, dunno why... thats why.. so fix ur board instead of naggin' on others plz.
    Help?!

  2. #2
    and the Hat of Clumsiness GanglyLamb's Avatar
    Join Date
    Oct 2002
    Location
    between photons and phonons
    Posts
    1,109
    BTW: hammer, i had to do that thread bumping, cos i had a black dot over the letter symbol sometimes <---, and when i tryed to watch the new replies, i had to write something, dunno why... thats why.. so fix ur board instead of naggin' on others plz.
    if it works with all the other ppl why wouldnt it work for you???
    so fix ur board instead of naggin' on others plz.[/
    mayb u have to fix something on ur comp instead of hammer fixin the board

  3. #3
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    The black dot denotes that you have posted on this thread.

    In answer to your question, emailing is gong to be pretty specific. What email facilities do you have available to you? Maybe you should read an RFC or two.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  4. #4
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001
    look up winsock and leave us alone
    PHP and XML
    Let's talk about SAX

  5. #5
    Registered User Help!'s Avatar
    Join Date
    Jan 2003
    Posts
    20

    hmm...

    what do you mean with e-mail facilities. or W/E it was?...
    Can't someone just write me a code? =D

    Btw, no need to be hostile...
    Help?!

  6. #6
    Registered User Cela's Avatar
    Join Date
    Jan 2003
    Posts
    362
    I have no idea how to do this with C or C++ in DOS, but if I were you I'd pipe the output of your program through a Perl mailer script. This makes things mucho simple. :-)
    Code:
    #!/usr/bin/perl -w
    
    use Mail::Mailer;
    
    $self = "sender's address";
    $address = "your address";
    
    $send = Mail::Mailer->new();
    $send->open({From => $self, To => $address, Subject => 'Facts'}) or die $!, "\n";
    
    while (<>) {
      print $send $_;
    }
    
    $send->close();
    Then you can just collect the answers with strcat and do this
    Code:
    char mail[10000] = "mail.pl ";
    strcat(mail, answers);
    system(mail);
    *disclaimer: I didn't test any of this, just wrote it off the top of my head. :-)
    *Cela*

  7. #7
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231

    Re: hmm...

    >>what do you mean with e-mail facilities.
    What method do you intend to use to send the email? Do you want to connect to yur ISP's outbound mail server and post an email for them to send?

    >>Can't someone just write me a code? =D
    No. This board is here to help you learn, not to do your dirty work for you.

    >>Btw, no need to be hostile...
    Hostility comes from consistantly asking and never giving; from hassling people to get them to do work for you for free; from never showing any effort of your own; from disobeying rules; from stating other peoples systems are broken simply because you don't know how to use them. Etc etc etc. I hope you get the point.

    People will be willing to help, just show some effort on your own part.

    Anyway, here's a starter... the RFC for SMTP
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  8. #8
    Registered User Help!'s Avatar
    Join Date
    Jan 2003
    Posts
    20

    Red face Hmm

    If i say it like this?

    I want it to be mailed to my HOTMAIL!


    What i am trying to tell you, is that i know just as much about c++ as a 3 year old baby..

    this is my program

    ---------------------------------------------------------------------------------
    #include <iostream>

    using namespace std;
    void main()
    {
    int Name,Age;
    cout<<"What is your name?: ";
    cin>>Name;
    cout<<"How old are you?: ";
    cin>>Age;
    }
    ---------------------------------------------------------------------------------
    That's all i want! and i want the fact to be send to my e-mail.. could that be sooo sooo hard?... someone.. plz
    Help?!

  9. #9
    Registered User Cela's Avatar
    Join Date
    Jan 2003
    Posts
    362
    >>could that be sooo sooo hard?
    Yea, actually it can. :-) You have to open a socket to an SMTP server and speak its language to get the message properly sent. Sockets alone are enough to fill two or three books with a thousand pages. But using a nice glue language you can send the mail in less than 5 lines. Here's a perfectly working program that does what you want using Perl to send the message
    Code:
    #include <iostream>
    #include <string>
    
    using namespace std;
    
    int main()
    {
      string name;
    
      cout<<"What is your name? ";
      getline(cin, name);
    
      system(string("mail.pl " + name).c_str());
    }
    This is the script that the above program calls, change the single quoted strings to match your system, mine is shown
    Code:
    #!/usr/bin/perl -w
    
    use Mail::Sendmail;
    
    $name = shift;
    %mail = ( SMTP    => 'mail.mindspring.com',
              To      => 'ansley_parker@yahoo.com',
              From    => 'ansley_parker@yahoo.com',
              Message => $name
             );
    
    sendmail(%mail) or die $Mail::Sendmail::error;
    
    print $Mail::Sendmail::log;
    Trust me when I say that doing what that Perl script does with C++ will be a *lot* longer and harder than you want. :-)
    *Cela*

  10. #10
    Registered User Help!'s Avatar
    Join Date
    Jan 2003
    Posts
    20

    hmm, still..

    still i have no idea how to put all of that togeather you sent me, and i dont really know pearl.. :/..

    I got like first 34 errors: D... then like 5.....

  11. #11
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001
    wow,
    sorry, but you're not fit to be a programmer. He just wrote EVERYTHING for you, all you had to do was copy and paste it into 2 files. His second set of code should be whatever.pl, you don't need to know perl becuase he made the script for you.
    PHP and XML
    Let's talk about SAX

  12. #12
    and the Hat of Clumsiness GanglyLamb's Avatar
    Join Date
    Oct 2002
    Location
    between photons and phonons
    Posts
    1,109
    Help a good idea for you would be to start with a tutorial about the basic thing.
    i mean programming isnt as simple as doing this
    Code:
    int sendit_to_my_hotmail_adress_right_now()
         {
           return 0;
           }
    so get urself a good tutorial (thatz my suggestion) to see what programming is really about

  13. #13
    Registered User Help!'s Avatar
    Join Date
    Jan 2003
    Posts
    20

    ye

    i have programming in school, just started.. know a little, but not pearl.. only c++..
    And i copied it all!.. and still, didnt work... had like 5 errors or something, gonna try it again lata.

  14. #14
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001
    first off, put std:: in front of cout in the code.
    second, do like gangly lamb said and go here.
    Third, it's PERL not pearl.

    and finally listen when we say you are NOT ready for this yet. Learn the basics first (go through all the tutorials from the link i gave you) then come back and take a shot at it. And you don't have to know perl to use that script.
    PHP and XML
    Let's talk about SAX

  15. #15
    Registered User Cela's Avatar
    Join Date
    Jan 2003
    Posts
    362
    >>And i copied it all!.. and still, didnt work...
    Don't forget to download and install Perl. :-)
    *Cela*

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

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