473,800 Members | 2,726 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Having problem in Email::Send through windows ?

65 New Member
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 2228
Icecrack
174 Recognized Expert New Member
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
4559
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 windows application it worked fine, however I need to use a service as I don't want to rely on a user being logged in. The errors I get are: Index #:System.Web.HttpException: Could not access 'CDO.Message' object. --->...
2
1746
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 myMail=CreateObject("CDO.Message") myMail.Subject = "Sending email with CDO" myMail.From = "Testing" myMail.To = "someone@yahoo.com"
2
2651
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 easyemail smtpserver=easyemail.server('something') smtpserver.login('usr@gmail.com', pwd) newletter=smtpsever.letter(smtpserver) newletter.sendto= newletter.sendcc=
2
1321
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 Amit Gupta
4
4137
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 other way to achieve it can any one help me pls,,,
2
2494
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
2099
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 which is filled out on their webpage, to their email address. Currently I am using a mailto: function which I desperately want to avoid. Also, if it helps this site is hosted through godaddy (windows package), if that makes any difference. Here is the...
9
2608
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
2703
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. Can any of u guys suggest me how to go about it? Regards, Sumanz
0
9691
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10507
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10279
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10255
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10036
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9092
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7582
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5473
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5607
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.