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

Im using the code
use Mail::Sendmail; my %mail = ( To => 'costas@othermedia.com', Subject => 'Test message', From => 'costas@othermedia.com', Message => "This is a very short message" ); $mail{smtp} = 'my.mail.server'; sendmail(%mail) || print "Error sending mail: $Mail::Sendmail::error\n +"; print "OK. Log says:\n", $Mail::Sendmail::log;
I get the result
OK. Log says: Mail::Sendmail v. 0.78 - Fri Jun 1 14:04:29 2001 Date: Fri, 1 Jun 2001 14:04 +0100
I am however getting no mail in my inbox. I have also tried without $mail{smtp} = 'my.mail.server'; but it still doesnt work
Can anyone help??

2001-06-02 Edit by Corion : Changed title

Replies are listed 'Best First'.
Re: Mail::Sendmail
by jepri (Parson) on Jun 01, 2001 at 18:03 UTC
    Try using Net::SMTP::Server::Client instead. I had similar troubles once upon a time. Net::SMTP will fail silently if your machine has a badly configured mail system (like no hostname, for instance).

    If that doesn't work I have a Perl SMTP relay sitting on my hard drive. It's not compliant with anything, but it works, and it can even mangle your messages in amusing ways.

    ____________________
    Jeremy
    I didn't believe in evil until I dated it.

      I've been hanging out in the Monastery too long. I read your tag line of
      I didn't believe in evil until I dated it.
      as saying
      I didn't believe in eval until I dated it.

      xoxo,
      Andy

      %_=split/;/,".;;n;u;e;ot;t;her;c; ".   #   Andy Lester
      'Perl ;@; a;a;j;m;er;y;t;p;n;d;s;o;'.  #   http://petdance.com
      "hack";print map delete$_{$_},split//,q<   andy@petdance.com   >
      
Re: Mail::Sendmail
by malloc (Pilgrim) on Jun 01, 2001 at 18:35 UTC
    It would be helpful if you could test with:

    $echo "hello, test" | /usr/lib/sendmail costas@othermedia.com


    To displace any thoughts of your sendmail being broken, that will point you in the right direction. -malloc
Re: Mail::Sendmail
by jorg (Friar) on Jun 01, 2001 at 18:08 UTC
    There is probably nothing wrong with your perl code. If you're sending this from a Unix box than this machine needs to be setup to send mail from the account you're using. I've had problems similar to this. I don't really know how exactly this sendmail config works but I suggest you look at your machine sendmail setup before poking around with the perl code.

    Jorg

    "Do or do not, there is no try" -- Yoda