vrempire has asked for the wisdom of the Perl Monks concerning the following question:

Hi guys,I have a very emergency question here(for me).I try to do a program to send mail.But I don't know whether I should use $mailprog = '/usr/lib/sendmail'; or $mailprog = '/usr/sbin/sendmail'; ,inside my perl 5 folder,I cannot see any folder like that.Do I neeed to create the folder first?And what is the program inside sendmail folder?I have tried with both the mailprog method and the Mail::Mailer method,but my program still cannot run.Please help me on this?I really appreciate your help..

Replies are listed 'Best First'.
Re: send mail cannot run
by swiftone (Curate) on Sep 07, 2000 at 20:19 UTC
    Alright, there are many questions here:
    1. Are you running on Windows, Mac, or some Unix variant? Your mention of folders implies Windows...
    2. Perl can send mail, or it can call an outside program to send mail.
    3. Sendmail is an outside program to send mail on unix-like systems. It is not a folder/directory, it is a program.
    4. See the answers in How do I send e-mail from my Perl Program?
    5. Please be more specific in the future. What does the program you are running look like? What errors does it give you when it doesn't work?
Re (tilly) 1: send mail cannot run
by tilly (Archbishop) on Sep 07, 2000 at 20:17 UTC
    Use Mail::Send. Easiest to get working, should be portable.
Re: send mail cannot run
by vrempire (Sexton) on Sep 07, 2000 at 21:37 UTC
    well,I run the program on windows 98,using the personal web server and I using the activestate perl version 5.6.0.I tried to install the MailTools,but it always fails.I download the MailTools from the CPAN site,and then I tried to install it using the PPM,using the command ppm>install MailTools and it said Error installing package MailTools.Could not locate PPD file. What is the correct way to get the MailTools installed to the my Perl 5.6 using the PPM.Or is there any other way? Besides, My program that I want to run look like this,just to test if the send mail program works,
    #!/usr/bin/perl use Mail::Mailer; $from_address = "vrempire"; $to_address = "vrempire\@hotmail.com"; $subject = "REGISTRATION FOR NEW MEMBER"; $body = "REGISTRATION FOR NEW MEMBER"; $mailer = Mail::Mailer->new(); $mailer->open({ From => $from_address, To => $to_address, Subject => $subject, }) or die "Can't open: $!\n"; print $mailer $body; $mailer->close();
    When I want to execute it using the command prompt,it returns the message
    Bad command or file name Can't locate auto/Mail/Util/mailaddress.al in @INC (@INC contains: c:/ +Perl/lib c:/Perl/site/lib .) at C:/Perl/lib/Mail/Mailer/smtp.pm line +21
    . Please help me on this,friends... Your concern is very appreciated by me.
Re: send mail cannot run
by Anonymous Monk on Sep 08, 2000 at 13:52 UTC
    (1) We use blat.exe to send mail on Windows from perl. Go to google.com and search on blat to get it.

    (2) You will need the URL or IP address of a mail server, or you will need to install and configure one. I have never done installed a mail server, but I think that there is more to it than finding the correct folder.

    (3) Your mail server must have mail relaying enabled if it is not located on your machine.