Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Mail-Sender CPAN distribution.

Report information
The Basics
Id: 416
Status: resolved
Priority: 0/
Queue: Mail-Sender

People
Owner: Nobody in particular
Requestors: prabhusundaram [...] hotmail.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.7.13.1
Fixed in: 0.7.13.1



Subject: Mail Sent ...
Hi: OS : SunOS 5.7 Generic_106541-16 sun4u sparc SUNW,Ultra-Enterprise Perl : 5.6.1 Perl Module: Mail-Sender 0.7.13.1 Once in a long while, my users are NOT receiving emails sent through your module. I know I can turn the debug on and go thru the log file but there will be atleast 100 mails sent everyday and it's hard to go thru them all every day to find out whether any emails were not sent! I have all the error logic built into the program so that whenever there is an error, it displays on the users web browser! But the problem is there are NO error messages and the recipients email addresses are also correct but missed few emails. In one case, a user sent couple of emails one after the other and the second email arrived far earlier than the first one! Any clues?? Is there a way to find out whether the emails did NOT go through? I have the following logic: my $mlSndr = new Mail::Sender {from => "$fromAddr", debug => "sndMail.log", smtp => "$smtpSvr"}; if ($mlSndr->OpenMultipart({to => "$bldMgrAdr", cc => "$ccAdr", subject => "$subMsg"})) { $mlSndr->Body(); $mlSndr->Send($compMsg); if ($mkFleExst == 1) { $mlSndr->SendFile( {encoding => 'Base64', description => "$mkFleNme", ctype => "$q->uploadInfo($webMkFle)->{'Content-Type'}", disposition => "attachment; filename = $webMkFle", file => "$tmpMkFle"} ); } unless ($mlSndr->Close()) { $errMsg = "<ol>$Mail::Sender::Error!!<BR><BR>"; errNotify (2, $errMsg); } } else { $errMsg = "<ol>$Mail::Sender::Error!!<BR><BR>"; errNotify (2, $errMsg); } ----------------- Thank you for going through this and I really appreciate your input! Prabhu.
[guest - Wed Mar 27 09:23:14 2002]: Show quoted text
> Once in a long while, my users are NOT receiving emails sent through > your module. > <snipped> > I have all the error logic built into the program > so that whenever there is an error, it displays on the users web > browser! But the problem is there are NO error messages and the > recipients email addresses are also correct but missed few emails.
See the comments below intermised with your code. Show quoted text
> In one case, a user sent couple of emails one after the other and > the second email arrived far earlier than the first one!
Mail::Sender only passes the email to the local mail server. When will the server deliver those messages is its bussines nad cannot be controled by Mail::Sender. Except maybe you could change the message priority, but I'm not sure it'd really affect the delivery time. Show quoted text
> Any > clues?? Is there a way to find out whether the emails did NOT go > through? I have the following logic: > > my $mlSndr = new Mail::Sender {from => "$fromAddr", > debug => "sndMail.log", > smtp => "$smtpSvr"};
Do NOT enclose variables in double quotes if you do not have to. The code above would be better written as my $mlSndr = new Mail::Sender {from => $fromAddr, debug => "sndMail.log", smtp => $smtpSvr}; Also you should test whether the object was created. For example if the $smtpSvr was a domain name and it was incorrect or the DNS server was down, the object creation would fail. Add if (ref $mlSndr) { # here comes the whole code using $mlSndr } else { $errMsg = "<ol>$Mail::Sender::Error!!<BR><BR>"; errNotify (2, $errMsg); } Show quoted text
> if ($mlSndr->OpenMultipart({to => "$bldMgrAdr", > cc => "$ccAdr", > subject => "$subMsg"})) {
Please add "ref" to the condition, or test whether the method returned a POSITIVE value. The method doesn't return an undef in case of error, but a negative error code : if (ref $mlSndr->OpenMultipart({to => $bldMgrAdr, cc => $ccAdr, subject => $subMsg})) { or if ($mlSndr->OpenMultipart({to => $bldMgrAdr, cc => $ccAdr, subject => $subMsg}) >= 0) { That's about it. Hope this'll give you some more info. HTH, Jenda
From: prabhusundaram [...] hotmail.com
Okay .. I changed the code like u said, pls take a look at it as I put two ref's in one statement .. will that be okay?!? my $mlSndr = new Mail::Sender {from => $fromAddr, debug => "sndMail.log", smtp => $smtpSvr}; if (ref $mlSndr and ref $mlSndr->OpenMultipart({to => $bldMgrAdr, cc => $ccAdr, subject => $subMsg})) { $mlSndr->Body(); $mlSndr->Send($compMsg); if ($mkFleExst == 1) { $mlSndr->SendFile( {encoding => 'Base64', description => "$mkFleNme", ctype => "$q->uploadInfo($webMkFle)-> {'Content-Type'}", disposition => "attachment; filename = $webMkFle", file => "$tmpMkFle"} ); } unless ($mlSndr->Close()) { $errMsg = "<ol>$Mail::Sender::Error!!<BR><BR>"; errNotify (2, $errMsg); } } else { $errMsg = "<ol>$Mail::Sender::Error!!<BR><BR>"; errNotify (2, $errMsg); } ------------- Thank you for responding at once and I really appreciate it! Prabhu. ------------------------ [JENDA - Wed Mar 27 09:43:04 2002]: Show quoted text
> [guest - Wed Mar 27 09:23:14 2002]:
> > Once in a long while, my users are NOT receiving emails sent through > > your module. > > <snipped> > > I have all the error logic built into the program > > so that whenever there is an error, it displays on the users web > > browser! But the problem is there are NO error messages and the > > recipients email addresses are also correct but missed few
emails. Show quoted text
> > See the comments below intermised with your code. >
> > In one case, a user sent couple of emails one after the other and > > the second email arrived far earlier than the first one!
> > Mail::Sender only passes the email to the local mail server. When
will Show quoted text
> the server deliver those messages is its bussines nad cannot be > controled by Mail::Sender. Except maybe you could change the message > priority, but I'm not sure it'd really affect the delivery time. >
> > Any > > clues?? Is there a way to find out whether the emails did NOT go > > through? I have the following logic: > > > > my $mlSndr = new Mail::Sender {from => "$fromAddr", > > debug => "sndMail.log", > > smtp => "$smtpSvr"};
> > Do NOT enclose variables in double quotes if you do not have to. > The code above would be better written as > > > my $mlSndr = new Mail::Sender {from => $fromAddr, > debug => "sndMail.log", > smtp => $smtpSvr}; > > Also you should test whether the object was created. For example if
the Show quoted text
> $smtpSvr was a domain name and it was incorrect or the DNS server was > down, the object creation would fail. Add > > if (ref $mlSndr) { > # here comes the whole code using $mlSndr > } else { > $errMsg = "<ol>$Mail::Sender::Error!!<BR><BR>"; > errNotify (2, $errMsg); > } > >
> > if ($mlSndr->OpenMultipart({to => "$bldMgrAdr", > > cc => "$ccAdr", > > subject => "$subMsg"})) {
> > Please add "ref" to the condition, or test whether the method
returned Show quoted text
> a POSITIVE value. The method doesn't return an undef in case of
error, Show quoted text
> but a negative error code : > > if (ref $mlSndr->OpenMultipart({to => $bldMgrAdr, > cc => $ccAdr, > subject => $subMsg})) { > > or > > if ($mlSndr->OpenMultipart({to => $bldMgrAdr, > cc => $ccAdr, > subject => $subMsg}) >= 0) { > > That's about it. Hope this'll give you some more info. > > HTH, Jenda
[guest - Wed Mar 27 12:15:19 2002]: Show quoted text
> Okay .. I changed the code like u said, pls take a look at it as I put > two ref's in one statement .. will that be okay?!? > > if (ref $mlSndr and ref $mlSndr->OpenMultipart({to => > $bldMgrAdr, > cc => $ccAdr, > subject => > $subMsg})) {
Yes, that's gonna be OK. And please, when you are replying, do delete the old post! Jenda