473,405 Members | 2,171 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,405 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 ##
  2.  
  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.        }
  9.  
  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.     }
  18.  
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 ???

Regards,
Vijayarl
Sep 22 '08 #1
1 2188
Icecrack
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. }
  4.  
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;
  2.  
  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

3
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...
2
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...
2
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...
2
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...
4
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...
2
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! ...
7
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...
9
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";
2
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....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.