CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Mail problem... very strange! (and quite urgent)

 



Peter Van Hoecke
Deleted

Mar 29, 2000, 2:22 AM

Post #1 of 5 (802 views)
Mail problem... very strange! (and quite urgent) Can't Post

hello,

I have tried this code:
-----------------------------------------
#!/usr/bin/perl
print "What's your name?";
$naampje = <STDIN>;
chomp($naampje);
...
open (MAIL,"|Peter.van_Hoecke\@ecom.be");
print MAIL "$naampje";
...
close (MAIL);
-----------------------------------------
Everywhere I look on the internet they tell me that this is the code onme has to use to send e-mail form Perl. However...

I get this error message:

Peter.van_Hoecke@ecom.be: not found

I get this message halfway through the program, and I don't know how to solve this. I am connected to a LAN network, and as you might have noticed the mail is adressed to myself.

Does anyone have an answer to this puzzle?
Peter.Van_Hoecke@ecom.be


Cure
User

Mar 28, 2000, 10:18 PM

Post #2 of 5 (802 views)
Re: Mail problem... very strange! (and quite urgent) [In reply to] Can't Post

HI

You can use the Net::Smtp module or the Mail::Sender module to accomplish your needs.

I think the Sender module is easier to use.
The Sender module was created by Jenda. you can d/l the module here.(if you dont already have the module on yout system)
This module works for unix and win32 platforms http://cpan.valueclick.com/authors/id/J/JE/JENDA/


EXAMPLE (heres a cgi script that will send email)

use Mail::Sender;


$sender = new Mail::Sender({from => 'yawp@io.com',
smtp => 'mail.assi.net'});

if(!(ref $sender) =~ /Sender/i) {
die $Mail::Sender::Error;
}


$sender->MailMsg({to => 'you@me.net',
subject => 'Testing Sender',
msg => "AN easy email interface?"});


if ( ($sender->{'error'}) < 0) {
print "ERROR: $Mail::Sender::Error\n";
}
else {
print "Msg Sent Ok\n";
}

Cure



[This message has been edited by Cure (edited 03-29-2000).]


seriousfun
Novice

Mar 29, 2000, 2:48 AM

Post #3 of 5 (802 views)
Re: Mail problem... very strange! (and quite urgent) [In reply to] Can't Post

try the following code:

open(MAIL, "|$sendmail -t");
print MAIL "To: <$email>\n";
print MAIL "From: <$email>\n";
print MAIL "Subject: something\n";
print MAIL "Your message\n";

close(MAIL);


you will also need to set $sendmail to the correct location. For example on my server it is

$sendmail= '/usr/sbin/sendmail';


Peter Van Hoecke
Deleted

Mar 29, 2000, 3:27 AM

Post #4 of 5 (802 views)
Re: Mail problem... very strange! (and quite urgent) [In reply to] Can't Post

Hmmm... the problem is that I'm using an NT on a LAN network with SMPT server...

I really don't know how I could refer to a sendmail directory....

How should I proceed?
Peter


Peter Van Hoecke
Deleted

Apr 2, 2000, 11:20 PM

Post #5 of 5 (802 views)
Re: Mail problem... very strange! (and quite urgent) [In reply to] Can't Post

Thanx, but I still have a problem...

When I try to install the module (and other modules), I get the following problem:

"make: Error -- Don't know how to make blib\lib\Mail\.exists"

It is probably a trivial problem, but I'm quite stuck?? does anyone care to help me?

PS: The Perl I use is installed with the MKS toolkit suite under NT4.

Peter.Van_Hoecke@ecom.be

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives