Hi lina,
On Mon, 2 Apr 2012 21:17:09 +0800
lina wrote:
> Hi,
>
> I don't know how to send email in perl with
> /usr/bin/mail
>
> Thanks ahead for any suggestions
You shouldn't use /usr/bin/mail to send E-mail in Perl, as there are better
(= more portable/etc.) solutions on CPAN. See:
https:/
On 2012-04-02 16:13, Samir Arishy wrote:
eval { $sender->send($email) };
die "Error sending email: $@" if $@;
Don't test $@, it is a global.
Make use of the return value of the eval:
eval {
$sender->send( $email );
1; # success
}
or do { # failure
my $ev
Here is the example i used to send emails from Perl scripts, might be
useful for you...!!!
sub sendEmail {
my ($file)=@_;
use Mail::Sender;
my $sender = new Mail::Sender {
smtp => '127.0.0.1',
from => 'ad...@domain.com'
} or die "unable to create the obj $!, $@.\n
This one worked for me...I am using gmail!!!
...
use Email::Send;
use Email::Send::Gmail;
use Email::Simple::Creator;
my $email = Email::Simple->create(
header => [
>From =>' x...@gmail.com',
To => 'y...@gmail.com',
Subject => 'msg from Perl',
],
body => 'send from Perl script.',
);
my $sender =
On Mon, Apr 2, 2012 at 9:34 PM, Shawn H Corey wrote:
> On 12-04-02 09:17 AM, lina wrote:
>>
>> Thanks ahead for any suggestions
>
>
> Have you tried searching CPAN for "mail"? http://search.cpan.org/
This short script is planned to use in remote server to check whether
has new file with "step*" n
On 12-04-02 09:17 AM, lina wrote:
Thanks ahead for any suggestions
Have you tried searching CPAN for "mail"? http://search.cpan.org/
--
Just my 0.0002 million dollars worth,
Shawn
Programming is as much about organization and communication
as it is about coding.
[updated for today's pr
Hi,
I don't know how to send email in perl with
/usr/bin/mail
Thanks ahead for any suggestions
Best regards,
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/