If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Smtp

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-28-04, 15:53
hclmanoj hclmanoj is offline
Registered User
 
Join Date: Oct 2003
Posts: 9
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...
Reply With Quote
  #2 (permalink)  
Old 01-28-04, 17:28
ika ika is offline
Registered User
 
Join Date: Oct 2003
Location: Slovakia
Posts: 482
Re: Smtp

Quote:
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.
Reply With Quote
  #3 (permalink)  
Old 02-01-04, 14:48
hclmanoj hclmanoj is offline
Registered User
 
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"
Reply With Quote
  #4 (permalink)  
Old 02-02-04, 04:10
ika ika is offline
Registered User
 
Join Date: Oct 2003
Location: Slovakia
Posts: 482
Re: SMTP

Quote:
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.
Reply With Quote
  #5 (permalink)  
Old 02-03-04, 14:24
hclmanoj hclmanoj is offline
Registered User
 
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...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On