Peculier Issue with Mail::Sender and the machine

--============== 76125188==
Content-Type: multipart/alternative; boundary=0016368e24fca598fb0465679668

--0016368e24fca598fb0465679668
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Hi All,

I have written a code which sends a mail using Mail::Sender utility.
When I ran this code at 2 differenct machine (Linux, Solaris), observed the
peculier issue.
At Linux this code works fine, and sends the mail. At solaris this is
not sending the mail, but no warnings & errors.
I used the specific path where the Mail::Sender utility is install. Your
help will be greatly appreciated.

#!/usr/bin/perl
#!/apps/perl/5.8.3/bin/perl
use Mail::Sender;

$sender = new Mail::Sender { from => 'mail [at] server.com',
};

$sender->Open({to => 'mail [at] server.com',
cc => 'mujju [at] server.com',
subject => 'A machine.'});
$sender->SendLineEnc("I'm sorry, but due to a big load of work,
I'll come at 10pm at best.");
$sender->SendLineEnc("\nMustafa");
$sender->Close;
--
--
Regards,
Mujju

--0016368e24fca598fb0465679668
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div>Hi All,</div>
<div>=A0</div>
<div>=A0=A0=A0 I have written a code which sends a mail using Mail::Sender =
utility. </div>
<div>When I ran this code at 2 differenct machine (Linux, Solaris), observe=
d the peculier issue. </div>
<div>At Linux this code works fine, and sends the mail.=A0 At solaris this =
is not=A0sending the mail, but no warnings & errors. </div>
<div>I used the specific path where the Mail::Sender utility is install. Yo=
ur help will be greatly appreciated. </div>
<div>
<p>#!/usr/bin/perl<br>#!/apps/perl/5.8.3/bin/perl<br>use Mail::Sender;</p>
<p>$sender =3D new Mail::Sender { from =3D> <a href=3D"mailto:'mail [at] =
server.com'">'mail [at] server.com'</a>,<br>=A0=A0=A0 };</p>
<p>$sender->Open({to =3D> <a href=3D"mailto:'mail [at] server.com'=
">'mail [at] server.com'</a>,<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0 cc =3D> <a href=3D"mailto:'mujju [at] server.com'">'mujju [at] =
server.com'</a>,<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 subje=
ct =3D> 'A machine.'});<br>
=A0$sender->SendLineEnc("I'm sorry, but due to a big load of wo=
rk,<br>=A0=A0=A0 I'll come at 10pm at best.");<br>=A0$sender->S=
endLineEnc("\nMustafa");<br>=A0$sender->Close;<br></p>-- <br>-=
-<br>Regards,<br>
Mujju </div>

--0016368e24fca598fb0465679668--

--============== 76125188==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--============== 76125188==--
perl perl [ Mi, 18 März 2009 17:58 ] [ ID #1994216 ]

RE: Peculier Issue with Mail::Sender and the machine

From: activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of Perl
Perl
Sent: 18 March 2009 16:58
To: activeperl [at] listserv.activestate.com
Subject: Peculier Issue with Mail::Sender and the machine

> Hi All,
>
> I have written a code which sends a mail using Mail::Sender
utility.
> When I ran this code at 2 differenct machine (Linux, Solaris),
observed the peculier issue.
> At Linux this code works fine, and sends the mail. At solaris this is
not sending the mail, but no warnings & > errors.
> I used the specific path where the Mail::Sender utility is install.
Your help will be greatly appreciated.
>
> #!/usr/bin/perl
> #!/apps/perl/5.8.3/bin/perl

Missing "use strict; use warnings;". You will be doing yourself a favour
by using them in all of your scripts.

> use Mail::Sender;
>
> $sender = new Mail::Sender { from => 'mail [at] server.com',
> };
>
> $sender->Open({to => 'mail [at] server.com',
> cc => 'mujju [at] server.com',
> subject => 'A machine.'});
> $sender->SendLineEnc("I'm sorry, but due to a big load of work,
> I'll come at 10pm at best.");
> $sender->SendLineEnc("\nMustafa");
> $sender->Close;

As you don't check for errors, it is not entirely surprising that you
don't see any. I am not familiar with Mail::Sender, but a quick glance
at the documentation shows that there are a number of ways to deal with
errors, the simplest being the on_error => 'die' parameter to the object
constructor. There are also some debugging options.

HTH

--
Brian Raven
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Brian Raven [ Mi, 18 März 2009 18:55 ] [ ID #1994217 ]
Perl » gmane.comp.lang.perl.active-perl » Peculier Issue with Mail::Sender and the machine

Vorheriges Thema: CGI perl : formating the output
Nächstes Thema: Re: OT: XUL Runner