in reply to Mail::Sender - authentication and design questions

First of all, let me say I despise you for having the only mail module available for Windoze - hack, pththt - when I'd already written my program to use Mail::Mailer (I'm developing a Windows program under Unix. You gotta problem with that?). I have enough problems with OO as it is.

Aside from that, the module works fine just talking to a smtp server and I don't use authentication. The only complaint I have is that there is a lot of information in the docs, but it isn't all that clear as to what I could, or should, be doing with this module. /msg me if you want help.

Performance question: it takes me 5 to 10 seconds to read in an ascii string from a barcode scanner, do 3 Oracle queries and send a short email. Is there a way of making the email sub quicker, a sort of "fire and forget" routine?

This happens to be the code that gets called after I insert into the database, so that the little darlings get an email receipt for the work they've handed in.

sub send_receipts { <snip> $sender = new Mail::Sender {smtp => $Mailserver, from => 'CS Handin <kendal>'}; $sender->MailMsg({to => "$userid\@keele.ac.uk", replyto => $handin_manager, subject => 'Receipt for work handed in', msg => $body}); $sender->Close; }
This gets called by
if ($receipt_by_email) { defined $email ? send_receipts($email, $descr, &is_work_late($assign)) : aquire_email_info($regno, $assign); }
A good question to ask at this point is - Is this the Right Thing to Do? Am I taking a hit in speed by using the Windows machine to talk to the SMTP server on the Unix box?

Lastly, you need more jokes in the documentation. Perhaps, Man who runs behind car becomes exhausted. I'm sorry I won't see you at the next YAPC in Munich to harrass you somemore.

Ea
:wq

Replies are listed 'Best First'.
Re: Re: Mail::Sender - design
by Jenda (Abbot) on Mar 26, 2002 at 18:39 UTC
    1. There are several others that work under Windows. Mail:Sendmail, Net::SMTP, ...

    2. Yes, I agree the docs are not too good. Any suggestions for improvement (or even whole parts rewritten ;-) are appreciated. I guess it would be quicker by email though.

    3. For the performance ... I think there are only two improvements possible. First ... if your script sends several mail messages keep the $sender object. It is NOT connected to the server, but still it would be cheaper. Second ... try to use the IP address instead of the name of the SMTP server.

      The fact that you connect to a Unix server from a Windows machine should not matter much as long as the connection between the two is reasonably quick. Try to telnet to.the.server 25 and see how long it took to get the SMPT server's greeting. If it does take too long you might consider (assuming the windows machine is Win2k or WinNT or WinXP) starting the "Simple Mail Transfer Protocol" service and setting it up to send all emails to that unix box (and restricting the access so that the SMTP on the windows box is only accessible from localhost).

      Let me know if you need help setting this up (I know for sure I WOULD have big problems trying to set up anything like this under Unix.)

    4. As far as the jokes are concerned ... when I wrote the first versions my english was too bad to even understand jokes, let alone write any. And since then I'm only patching and patching and patching ... which makes the docs quite messy actually. :-(