Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 16th, 2012, 09:07 PM
sodimbakam01 sodimbakam01 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 5 sodimbakam01 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 13 sec
Reputation Power: 0
Unable to send emails from Lotus Notes

Hi,
I am trying to send emails using Perl script from Lotus Notes, here is the code i am trying

#!/usr/bin/perl

use MIME::Lite;

# Set this variable to your smtp server name
my $ServerName = ldap.servername.com";

my $from_address = 'mycompany@test.com';
my $to_address = 'myname@test.com';
my $subject = 'MIME Test: Text';
my $mime_type = 'text';
my $message_body = "Testing text in email.\n";

# Create the initial text of the message
my $mime_msg = MIME::Lite->new(
From => $from_address,
To => $to_address,
Subject => $subject,
Type => $mime_type,
Data => $message_body
)
or die "Error creating MIME body: $!\n";


# Attach the text file
my $filename = 'C:\test.txt';
my $recommended_filename = 'test.txt';
$mime_msg->attach(
Type => 'application/text',
Path => $filename,
Filename => $recommended_filename
)
or die "Error attaching text file: $!\n";

# encode body of message as a string so that we can pass it to

Net::SMTP.
my $message_body = $mime_msg->body_as_string();

# Let MIME::Lite handle the Net::SMTP details
MIME::Lite->send('smtp', $ServerName);
$mime_msg->send() or die "Error sending message: $!\n";


I am receiving Unable to connect Server, actually, my company is using LDAP protocol, but here i have mentioned "smtp" in send function, but i am not sure if this is the actual issue or not ?, could someone help me on this... ?

Reply With Quote
  #2  
Old December 17th, 2012, 04:47 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 9th Plane (9000 - 9499 posts)
 
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
Posts: 9,381 Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Weeks 1 Day 20 h 5 m 43 sec
Reputation Power: 4080
Ask your sys admin if they support SMTP in the first place or not. I'm guessing they don't, which explains the "Unable to connect to server" message. Or perhaps they use a different SMTP server for sending mail (LDAP is a different protocol from SMTP and used for a different purpose).
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Unable to send emails from Lotus Notes

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap