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

I have just begun recently working with Mail::Sender and am having problems with the MailMsg object method. Namely, it does not seem to be working (I'm not getting any emails) but there is no documentation on what it is supposed to return on failure.

I checked the $Mail::Sender::Error variable which is supposed to store the most recent error and find the phrase 'The SMTP server ' followed by the contents of the body of my message.

I'm calling it thusly (from within a wrapper class):

return $self->{sender}->MailMsg(%args);

Has anyone any experience with Mail::Sender and with the MailMsg function in particular?

I'm not even sure that's relevant as I don't seem to have any indication that MailMsg sends out a failure response if there's a problem. It currently sends back nothing, and I don't know whether or not to take that as failure, as i see nothing in the documentation about it.

Replies are listed 'Best First'.
Re: Mail::Sender issue
by suaveant (Parson) on May 04, 2001 at 21:36 UTC
    I don't know if this is your problem, but I had a problem with Mail::Sender once that was caused from not having the port for smtp specified in /etc/services, but it worked if I passed the port (25) in to the object myself... try that. Granted there is a good chance that is not yor problem...
                    - Ant
      Thanks but no, I managed to do Mail::Sender->new() just fine, which is where i specified the smtp server.
        but did you specify the port, or let it use the default?
                        - Ant
Re: Mail::Sender issue
by suaveant (Parson) on May 04, 2001 at 21:58 UTC
    what is MailMsg returning, it should return an error number if it fails...
                    - Ant

      nada. I've tested it by doing

      print $self->{sender}->MailMsg(...)
        write a quick example script that fails the same way and post it... I'll see if it fails for me... and look it over.
                        - Ant