473,218 Members | 1,384 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,218 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 2178
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

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

Similar topics

by: Gerard | last post by:
Hello I have created a windows service to monitor a database, it starts some checks when a timer elapses. The checks send emails depending on their findings. My issue is that when I created a...
by: Li Pang | last post by:
Hi, I have following codes in VB6 for sending the email on a server installed SMTP. It works fine. Now I want to update it with VB.NET 2.0 by using ..NET.Mail object. VB6 code: Dim myMail Set...
by: oyster | last post by:
I find that the existing email moudle is some hard for me to understand, especially the part of how to set the CC, BCC and attach the files. Is there any more easy one like this p-code? import...
by: Amit1982 | last post by:
Hi All, Can I send e-mail(automatically) to the different users but the time is fixed(such as end of day 5:PM ). If yes and any one have good idea about it please reply asap.. Thanks And Regards...
by: jeevik | last post by:
Hello everybody I have to send a mail on a particular day some what like birthday reminder .. I came to know this can be achieve by using cron job but i dont know how to use it .. or tell me any...
by: kennykenn | last post by:
Hi, Ive producd code to send an email after capturing info off a form,it works fine locally but when i put it live it doesnt work! the code is stopin at 'msg.send' any ideas, here the code! ...
by: SAF22 | last post by:
Hi guys, I'm a pretty basic coder with very limited skills. I've been researching this question everywhere and I can't find anything that works. What I'm trying to do is simply send a form...
by: luke noob | last post by:
This is my script..... <?php $to = "example@example.co.uk"; $subject = "subject"; //minimum characters allowed in the message box $msg_min_chars = "10";
by: sumanz | last post by:
Hello, I work from home and I connect to the environment (on AIX) using putty. I have a zip file on my laptop (OS: windows xp prof) , I need to move that file from windows to AIX box thru putty....
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.