471,887 Members | 1,411 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,887 software developers and data experts.

Having problem in Email::Send through windows ?

Hi All,

I need to send a email based on the flag value, am using Email::Send module(CPAN).
Requirement :
1.Based on the $email_flag, call the send_email function so, script goes like this:
Expand|Select|Wrap|Line Numbers
  1. ## In main function ##
  3. if($email_flag == 1){
  4.    &send_email; ## calling the send_email sub-function
  5.    }
  6.   else{
  7. print "There is some problem for process execution\n please check the script\n";
  8.        }
  10. ### sub - function ####
  11. sub send_email {
  12. my $msg = q(From: abc.xyz@xyz.com
  13.     To:xyz.abc@xyz.co.uk
  14.     Subject:Time to Analyse - Report !!!
  15.     );
  16.         Email::Send->new({mailer => 'Sendmail'})->send($msg);
  17.     }
When i run this script, it goes to the sen_email sub function but only problem is
not getting the mail.
don't know where is the mistake nor the script give any clue while running...
Am using Acitvestate perl v5.10.0 & OS is win2k.
Is there any other method where i can send simple mail ???

Sep 22 '08 #1
1 2105
174 Expert 100+
so when you call the function you should place debug method

Expand|Select|Wrap|Line Numbers
  1. &send_email || die "Error: $!"; 

or try this,

Expand|Select|Wrap|Line Numbers
  1. if (my $error = $sender->send($message)) {
  2.     die $error;
  3. }
this should give you more detail.

also i don't think that this is for Windows OS,

but please try printing this out

Expand|Select|Wrap|Line Numbers
  1. use Email::Send;
  3. my @available = $sender->all_mailers;

this would print if you have any mailers that can send the mail with this module
Sep 23 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Li Pang | last post: by
2 posts views Thread by oyster | last post: by
2 posts views Thread by Amit1982 | last post: by
9 posts views Thread by luke noob | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.