Results 1 to 5 of 5

Thread: Smtp

  1. #1
    Join Date
    Oct 2003
    Posts
    9

    Unanswered: Smtp

    hi dear,

    Thank u fro ur reply.

    Actually i want to collect all my mails from my mail box and save it in my system. And of course i also need to send emails from my system.
    Is there any posibility for the above using the C / C++ or whether it can be done in the Qmail/Postfix


    plz help me...

    awaiting for ur reply...

  2. #2
    Join Date
    Oct 2003
    Location
    Slovakia
    Posts
    482

    Re: Smtp

    Originally posted by hclmanoj
    hi dear,

    Thank u fro ur reply.

    Actually i want to collect all my mails from my mail box and save it in my system. And of course i also need to send emails from my system.
    Is there any posibility for the above using the C / C++ or whether it can be done in the Qmail/Postfix


    plz help me...

    awaiting for ur reply...
    Sorry, for this purpose qmail or postfix are not usefull.
    For automatic e-mail retriving you could use the fetchmail.
    For sending (also for retriving) you can write simple script in perl.
    C or C++ is the hardest way to achieve your goal.

  3. #3
    Join Date
    Oct 2003
    Posts
    9

    SMTP

    hello sir,

    As u told me, i tried the SMTP service in PERL. Itz fine. In my home system(win XP) i wrote a perl program for the SMTP. i have attached the code below. Then i connected my system to the internet through dial up service. And then i executed the perl program from command prompt. During execution it showed me some errors which i am not aware of. Plz help me in clearing off the errors. I also attached the errors during execution.

    CODE:
    -----

    #!/usr/bin/perl
    print "Content-type: text/plain", "\n\n";

    use Net:MTP;


    my $smt;
    my $serv = "pec.edu";

    $smt = Net:MTP->new($serv,Debug => 1);
    die "No server" unless $smt;

    $smt->mail('mohanaram007@sancharnet.in');
    $smt->to('manojpec@yahoo.co.in');

    # Start the mail
    $smt->data();

    # Send the header
    # This address will appear in the message
    $smt->datasend("To:manojpec@yahoo.co.in\n");

    # So will this one
    $smt->datasend("From:mohanaram007@sancharnet.in\n");
    $smt->datasend("Subject: Test Message\n");
    $smt->datasend("\n");

    # Send the body.
    $smt->datasend("Hello World!\n\n");

    # Send the termination string
    $smt->dataend();

    # Close the connection
    $smt->quit();



    ERROR DURING EXECUTION:
    -----------------------
    C:\PERL>perl one.pl
    Content-type: text/plain


    Net:MTP: Net:MTP(2.24)
    Net:MTP: Net::Cmd(2.21)
    Net:MTP: Exporter(5.566)
    Net:MTP: IO:ocket::INET(1.26)
    Net:MTP: IO:ocket(1.27)
    Net:MTP: IO::Handle(1.21)

    Net:MTP=GLOB(0x182d970)<<< 220 host11.host11-server.com ESMTP Sendmail 8.11.6/
    8.11.6; Sun, 1 Feb 2004 14:26:13 -0500
    Net:MTP=GLOB(0x182d970)>>> EHLO localhost.localdomain
    Net:MTP=GLOB(0x182d970)<<< 250-host11.host11-server.com Hello [61.1.204.203],
    pleased to meet you
    Net:MTP=GLOB(0x182d970)<<< 250-ENHANCEDSTATUSCODES
    Net:MTP=GLOB(0x182d970)<<< 250-8BITMIME
    Net:MTP=GLOB(0x182d970)<<< 250-SIZE
    Net:MTP=GLOB(0x182d970)<<< 250-DSN
    Net:MTP=GLOB(0x182d970)<<< 250-ONEX
    Net:MTP=GLOB(0x182d970)<<< 250-ETRN
    Net:MTP=GLOB(0x182d970)<<< 250-XUSR
    Net:MTP=GLOB(0x182d970)<<< 250-AUTH LOGIN PLAIN
    Net:MTP=GLOB(0x182d970)<<< 250 HELP
    Net:MTP=GLOB(0x182d970)>>> MAIL FROM:<mohanaram007@sancharnet.in>
    Net:MTP=GLOB(0x182d970)<<< 250 2.1.0 <mohanaram007@sancharnet.in>... Sender ok

    Net:MTP=GLOB(0x182d970)>>> RCPT TO:<mohanaram007@sancharnet.in>
    Net:MTP=GLOB(0x182d970)<<< 550 5.7.1 <mohanaram007@sancharnet.in>... Relaying
    denied. IP name lookup failed [61.1.204.203]
    Net:MTP=GLOB(0x182d970)>>> DATA
    Net:MTP=GLOB(0x182d970)<<< 503 5.0.0 Need RCPT (recipient)
    Net:MTP=GLOB(0x182d970)>>> To: mohanaram007.in
    Net:MTP=GLOB(0x182d970)>>> From: mohanaram007.in
    Net:MTP=GLOB(0x182d970)>>> Subject: Test Message
    Net:MTP=GLOB(0x182d970)>>>
    Net:MTP=GLOB(0x182d970)>>> Hello World!
    Net:MTP=GLOB(0x182d970)>>> .
    Net:MTP=GLOB(0x182d970)<<< 500 5.5.1 Command unrecognized: "To: mohanaram007.i
    nFrom: mohanaram007.in"
    Net:MTP=GLOB(0x182d970)>>> QUIT
    Net:MTP=GLOB(0x182d970)<<< 500 5.5.1 Command unrecognized: "Subject: Test Mess
    age"

  4. #4
    Join Date
    Oct 2003
    Location
    Slovakia
    Posts
    482

    Re: SMTP

    Originally posted by hclmanoj
    hello sir,

    As u told me, i tried the SMTP service in PERL. Itz fine. In my home system(win XP) i wrote a perl program for the SMTP. i have attached the code below. Then i connected my system to the internet through dial up service. And then i executed the perl program from command prompt. During execution it showed me some errors which i am not aware of. Plz help me in clearing off the errors. I also attached the errors during execution.

    CODE:
    -----

    #!/usr/bin/perl
    print "Content-type: text/plain", "\n\n";

    use Net:MTP;


    my $smt;
    my $serv = "pec.edu";

    $smt = Net:MTP->new($serv,Debug => 1);
    die "No server" unless $smt;

    $smt->mail('mohanaram007@sancharnet.in');
    $smt->to('manojpec@yahoo.co.in');

    # Start the mail
    $smt->data();

    # Send the header
    # This address will appear in the message
    $smt->datasend("To:manojpec@yahoo.co.in\n");

    # So will this one
    $smt->datasend("From:mohanaram007@sancharnet.in\n");
    $smt->datasend("Subject: Test Message\n");
    $smt->datasend("\n");

    # Send the body.
    $smt->datasend("Hello World!\n\n");

    # Send the termination string
    $smt->dataend();

    # Close the connection
    $smt->quit();



    ERROR DURING EXECUTION:
    -----------------------
    C:\PERL>perl one.pl
    Content-type: text/plain


    Net:MTP: Net:MTP(2.24)
    Net:MTP: Net::Cmd(2.21)
    Net:MTP: Exporter(5.566)
    Net:MTP: IO:ocket::INET(1.26)
    Net:MTP: IO:ocket(1.27)
    Net:MTP: IO::Handle(1.21)

    Net:MTP=GLOB(0x182d970)<<< 220 host11.host11-server.com ESMTP Sendmail 8.11.6/
    8.11.6; Sun, 1 Feb 2004 14:26:13 -0500
    Net:MTP=GLOB(0x182d970)>>> EHLO localhost.localdomain
    Net:MTP=GLOB(0x182d970)<<< 250-host11.host11-server.com Hello [61.1.204.203],
    pleased to meet you
    Net:MTP=GLOB(0x182d970)<<< 250-ENHANCEDSTATUSCODES
    Net:MTP=GLOB(0x182d970)<<< 250-8BITMIME
    Net:MTP=GLOB(0x182d970)<<< 250-SIZE
    Net:MTP=GLOB(0x182d970)<<< 250-DSN
    Net:MTP=GLOB(0x182d970)<<< 250-ONEX
    Net:MTP=GLOB(0x182d970)<<< 250-ETRN
    Net:MTP=GLOB(0x182d970)<<< 250-XUSR
    Net:MTP=GLOB(0x182d970)<<< 250-AUTH LOGIN PLAIN
    Net:MTP=GLOB(0x182d970)<<< 250 HELP
    Net:MTP=GLOB(0x182d970)>>> MAIL FROM:<mohanaram007@sancharnet.in>
    Net:MTP=GLOB(0x182d970)<<< 250 2.1.0 <mohanaram007@sancharnet.in>... Sender ok

    Net:MTP=GLOB(0x182d970)>>> RCPT TO:<mohanaram007@sancharnet.in>
    Net:MTP=GLOB(0x182d970)<<< 550 5.7.1 <mohanaram007@sancharnet.in>... Relaying
    denied. IP name lookup failed [61.1.204.203]
    Net:MTP=GLOB(0x182d970)>>> DATA
    Net:MTP=GLOB(0x182d970)<<< 503 5.0.0 Need RCPT (recipient)
    Net:MTP=GLOB(0x182d970)>>> To: mohanaram007.in
    Net:MTP=GLOB(0x182d970)>>> From: mohanaram007.in
    Net:MTP=GLOB(0x182d970)>>> Subject: Test Message
    Net:MTP=GLOB(0x182d970)>>>
    Net:MTP=GLOB(0x182d970)>>> Hello World!
    Net:MTP=GLOB(0x182d970)>>> .
    Net:MTP=GLOB(0x182d970)<<< 500 5.5.1 Command unrecognized: "To: mohanaram007.i
    nFrom: mohanaram007.in"
    Net:MTP=GLOB(0x182d970)>>> QUIT
    Net:MTP=GLOB(0x182d970)<<< 500 5.5.1 Command unrecognized: "Subject: Test Mess
    age"
    This is very important:
    Net:MTP=GLOB(0x182d970)<<< 550 5.7.1 <mohanaram007@sancharnet.in>... Relaying
    denied. IP name lookup failed [61.1.204.203]

    Your SMTP does not allow relaying from another hosts or your SMTP does not allow relaying for hosts without reverse DNS entry.
    Possibly you need reverse DNS entry for your host.
    Or try contact admin for enabling relaying for your host.

  5. #5
    Join Date
    Oct 2003
    Posts
    9

    SMTP

    hi dear,

    I cant do it. the same error is coming again and agian. Plz tell me in detail. what should i do next. remeber i am working in my home PC connected to internet throgh dial up service and i would like to send mail to my friends without going to any web.(like outlook xpress)

    Plz help me...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •