Hello,
perhaps this questions is not directly MySql related but MySql is very related with my question. I'm learning Paul Dubois MySql and Perl for the web and I have a lot of problems make working the Mail::Sendmail module.


Here's the concerning script :

#!/usr/bin/perl -w
# testmail.pl - Send mail using the Mail::Sendmail module

use strict;
use Mail::Sendmail;

my $recipient = "[EMAIL PROTECTED]";
my $sender = "[EMAIL PROTECTED]"; #this is replaced with my personal email


# Set up hash containing mail message information

my %mail = (
        From    => $sender,
        To              => $recipient,
        Subject => "I'm sending your mail",
        Message => "This is the message body.\n"
);

sendmail (%mail) or die "sendmail failure sending to $mail{To}: $!\n";
exit(0);

When I execute the script I always receive a warning and an error. The warning tells that realy is not allowed and I understand this, this is because my SMTP server needs authentication, but I'm unable to configure Sendmail for this.

The error message is "Bad file descriptor" and nothing more. This message is meanless for me, it doesn't make sense at all.

The sendmail.pm file is configured to have the name of my smtp and pop servers, so I don't keept localhost, so I don't need an email server installed.

# *************** Configuration you may want to change *******************
# You probably want to set your SMTP server here (unless you specify it in
# every script), and leave the rest as is. See pod documentation for details

%mailcfg = (
   # List of SMTP servers:
   'smtp'    => [ qw(mail.messagingengine.com) ],    #was localhost
   #'smtp'    => [ qw( mail.mydomain.com ) ], # example

'from' => '[EMAIL PROTECTED]', # default sender e-mail, used when no From header in mail

'mime' => 1, # use MIME encoding by default

   'retries' => 1, # number of retries on smtp connect failure
   'delay'   => 1, # delay in seconds between retries

   'tz'      => '', # only to override automatic detection
   'port'    => 25, # change it if you always use a non-standard port
   'debug'   => 0 # prints stuff to STDERR
);

# *******************************************************************

Someone can help?

Raikonn

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail



-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to