473,378 Members | 1,699 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,378 software developers and data experts.

Sending emails using perl script - issue with the script

Hi All,

I'm using trying to make a script to send email using perl.

I found this in

http://bytes.com/topic/perl/answers/...erl-send-email

I found this one, however it doesn't work.
Expand|Select|Wrap|Line Numbers
  1. ////////////////////////////////////////////
  2. use strict; 
  3.    use warnings;  
  4.  
  5.    use Mail::Sender::Easy qw(email); 
  6.  
  7.     print "Content-type: text/plain\n\n";
  8.  
  9.  
  10.     email({
  11.         #from email address need to change
  12.         'from'         => 'omar.samir3000@gmail.com',
  13.         'to'           => 'omar.samir3000@gmail.com',
  14.         #'cc'           => 'your_pal@ddre.ss',
  15.         'subject'      => 'Perl is great!',
  16.         'priority'     => 2, # 1-5 high to low
  17.         'confirm'      => 'delivery, reading',
  18.         'smtp'         => '192.168.2.111',
  19.         'port'         => 25,
  20.         #'auth'         => 'LOGIN',
  21.         'authid'       => 'andrew@inovaventure.com',
  22.         'authpwd'      => 'andrew2100',
  23.         '_text'        => 'Hello *World* :)',    
  24.         #'_html'        => 'Hello <b>World</b> <img src="cid:smile1" />',
  25.         #'_attachments' => {
  26.             #'smiley.gif' => {
  27.                 #'_disptype'   => 'GIF Image',
  28.                 #'_inline'     => 'smile1',
  29.                 #'description' => 'Smiley',
  30.                 #'ctype'       => 'image/gif',    
  31.                 #'file'        => '/home/foo/images/smiley.gif',
  32.             #},
  33.             #'mydata.pdf' => {
  34.                 #'description' => 'Data Sheet',  
  35.                 #'ctype'       => 'application/pdf',
  36.                 #'msg'         => $pdf_guts,
  37.             #},
  38.         #},
  39.     }) or die "email() failed: $@";
////////////////////////////////////
It shows that : email() failed: Mail::Sender::Error: Connection not established

Any help?!
Sep 4 '13 #1
2 1772
numberwhun
3,509 Expert Mod 2GB
I can only imagine that the IP address you specified is your mail server. If it is, great. I would ask why you commented out the "Auth" line though? Have you tried uncommenting that? Also, try printing $! in the error as well to try and get more information.

Regards,

Jeff
Sep 4 '13 #2
RonB
589 Expert Mod 512MB
Why would you expect it to work?

You need to pass YOUR connection info, not someone else's that is on a private network via a vpn connection.

Mail::Sender::Easy is a little outdated. It hasn't been updated since 2006.

There are a number of other more up to date modules. For simplicity of use, I prefer MIME::Lite.
Sep 4 '13 #3

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

Similar topics

3
by: A | last post by:
Hi all! I would like to ask a question on sending emails... I have a web application that requires sending emails using email templates. The templates that I've made are separate HTML files...
4
by: Nicole | last post by:
I found this code below to use to send emails using VB with Outlook. However, it gives these errors. 'Send' is ambiguous across the inherited interfaces 'Outlook._MailItem' and...
4
by: aroraamit81 | last post by:
Hi, I am using CDO component to send emails through my ASP page as I am having IIS on windows XP.......... Now the mails goes and gets into mailroot\Queue folder but does not reaches to the...
2
by: Maxelcat | last post by:
HI I am really confused (and getting a bit stressed!!!) I want to send email from a form on the website I am developing. I have to use .asp (the host server doesn't have .net) After many...
14
by: sridhar | last post by:
iam having user account on an exchangeserver. with that can i send an email using python? if iam using the following code iam getting error fromAddress = 'sridhar_kasturi@satyam.com'...
6
by: TanmayAnand | last post by:
Hi, This time I am working on PERL. I want to send SMS alert using my perl script. Can i do this. If yes then how?
3
by: lizii | last post by:
Hey there - hopefully last newbie question i will ask for a while! I want my application to work where you click a button - and it either: a) open a email application - insert the correct email...
1
by: sarahmiller | last post by:
Hi I need a script that will send and email with a file/folder, in VB by itself after i click on it, also could a whole folder be sent and would there be a way to make it repeat itself everyday,...
0
by: damimkader | last post by:
Hi, I'm trying to send emails using a Macro based on an Excel Sheet and the Email Client I'm using is Lotus Notes. OS used - Windows Xp. Language - VB Below is the Code I'm using for doing...
1
Ali Rizwan
by: Ali Rizwan | last post by:
Hi all, How can i send email to any email address using a specific email address or unknown email address.... Email may contain some attachments..... Thanx >> ALI <<
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.