sylph001 has asked for the wisdom of the Perl Monks concerning the following question:
I'm installing my perl script on one server and expecting the script to send out an email to a group email address so everybody in the group can receive this email.
However after install, I noticed the emails sent to the group was not received at all.
In order to find out the reason, I wrote test scripts to test sending emails from three different servers. These three serves reside in the same network.
On each server, I tried two different methods to send email that I know so far, hoping to give better coverage for the test.
Method 1: MIME::Lite (which is also used in my script installed at the beginning)
my $msg = MIME::Lite->new( To => 'Alias@xxxx.com', Subject = $subject, Type => 'text/plain, Data => $message );
Method 2: system function call
open $CMD, "|/usr/bin/mailx -s \'$subject\' Alias\@xxxx.com" or die("C +annot open CMD"); print $CMD $message; close $CMD;
I tested to send the email to both the group email address and my individual email address respectively, for comparison.
The result looks interesting and I hadn't expected our servers to vary so much on this issue:
Server A: Send to group address fails Send to individual address OK
Server B: Send to group address fails Send to individual address fails
Server C: Send to group address fails Send to individual address OK
My Monks, based on my tests, do you think we can locate the email problem, or does it look like it's caused by some other configurations from each of the servers?
My second question is, could you let me know if there is any better way of sending emails by perl, that's possibly safer?
Many thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Send email and attachement without MIME?
by tangent (Parson) on Jul 23, 2015 at 03:59 UTC | |
|
Re: Send email and attachement without MIME?
by 1nickt (Canon) on Jul 23, 2015 at 03:36 UTC | |
|
Re: Send email and attachement without MIME?
by Anonymous Monk on Jul 23, 2015 at 04:23 UTC | |
by 1nickt (Canon) on Jul 23, 2015 at 14:02 UTC |