Hi,

I wrote following program to send an email to my email id, looks like it is
running. But when I checked my mailbox, does not find any email.
Can anybody help me to find if anything I am missing here.
I appreciate for your reply.

thanks,

Bilashi


1.
sendmail.pl
============

#!/home/y/bin/perl -w


# set up email message
my $sendmail = "/usr/sbin/sendmail -t -v";
my $reply_to = "Reply-to: [email protected]";
my $subject = "Subject: Testmail";
my $content = "Hello and how are you doing? This is the message body";



my $to = "To: [email protected]";
open(SENDMAIL, "|$sendmail") or die "Cannot send mail: $!";
print SENDMAIL "$reply_to\n";
print SENDMAIL "$subject\n";
print SENDMAIL "$to\n";
print SENDMAIL "Content-type: text/plain\n\n";
print SENDMAIL "$content\n";
print SENDMAIL "\.\n";
close(SENDMAIL);


2.

When I ran this program looks like it is working

perl sendmail.pl
bilashi_s...@.... Connecting to [127.0.0.1] via relay...
220 materialbuilt.greatamerica.corp.yahoo.com ESMTP Sendmail 8.13.8/8.13.8; Tue,
14 Jul 2009 22:23:45 -0700
>>> EHLO materialbuilt.greatamerica.corp.yahoo.com
250-materialbuilt.greatamerica.corp.yahoo.com Hello localhost.localdomain
[127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
>>> MAIL From:<bila...@...> SIZE=153
auth=bila...@...
250 2.1.0 <bila...@...>... Sender ok
>>> RCPT To:<bilashi_s...@...>
>>> DATA
250 2.1.5 <bilashi_s...@...>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 n6F5Njco010145 Message accepted for delivery
bilashi_s...@.... Sent (n6F5Njco010145 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT


      
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to