Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Send Mail form my PC without using smtp server?

by willyyam (Priest)
on Mar 29, 2005 at 15:32 UTC ( #443151=note: print w/replies, xml ) Need Help??


in reply to Send Mail form my PC without using smtp server?

I might also suggest Mail::Mailer. Here is a proof-of-concept program for you to look at that acts as a Perl-based email transmission client:

#!/usr/bin/perl -w use Mail::Mailer; $smtp = Mail::Mailer->new("smtp","Server","smtp.server"); print "To: "; $to = <STDIN>; chomp($to); print "Subject: "; $subject = <STDIN>; chomp($subject); print "Body:\n"; while ($line = <STDIN>) { last if $line eq ".\n"; $body .= $line; } chomp($body); print "Opening SMTP connection...\n"; $smtp->open({ "From" => "email\@example.com", "To" => $to, "Subject" => $subject }); print $smtp $body; print "Sending email...\n"; $smtp->close() or die "Can't close mailer: $!"; print "Mail sent.\n";

Obviously, using strict is recommended.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://443151]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2019-12-07 17:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (162 votes). Check out past polls.

    Notices?