CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Free smtp server supporting perl

 



zak100
Novice

Nov 2, 2013, 5:49 AM

Post #1 of 9 (790 views)
Free smtp server supporting perl Can't Post

Hi,
I am trying to run an email program using perl. I am getting following error:

Code
D:\Zulfi\PERL MAIN FOLDER>perl email1.pl 
SMTP Failed to connect to mail server:
at email1.pl line 19.


Kindly guide me some easily installed SMTP mail server compatible with Perl.

Zulfi.


FishMonger
Veteran / Moderator

Nov 2, 2013, 6:25 AM

Post #2 of 9 (785 views)
Re: [zak100] Free smtp server supporting perl [In reply to] Can't Post


Quote
Kindly guide me some easily installed SMTP mail server compatible with Perl.


All SMTP servers are "compatible with Perl".

I assume you mean you would like us to help you troubleshoot why your script is failing to connect the the mail server.

You'll need to post your script so we can see what you're doing and show you how to output more meaningful error messages.


zak100
Novice

Nov 2, 2013, 8:12 AM

Post #3 of 9 (779 views)
Re: [zak100] Free smtp server supporting perl [In reply to] Can't Post

Hi,
My code is:

Code
#!/usr/bin/perl 
use MIME::Lite;

$to = 'zulfi6000@yahoo.com';
$cc = '';
$from = 'webmaster@yahoo.com';
$subject = 'Test Email';
$message = '<h1>This is test email sent by Perl Script</h1>';

$msg = MIME::Lite->new(
From => $from,
To => $to,
Cc => $cc,
Subject => $subject,
Data => $message
);

$msg->attr("content-type" => "text/html");
$msg->send;
print "Email Sent Successfully\n";


I have no email server installed in my computer. I have windows7. Kindly guide me about some email server easy to install.

Zulfi.


FishMonger
Veteran / Moderator

Nov 2, 2013, 9:52 AM

Post #4 of 9 (772 views)
Re: [zak100] Free smtp server supporting perl [In reply to] Can't Post

You could install IndigoMail email server.
http://www.indigostar.com/indigomail.php

Or, you could direct your email to route through any external SMTP server you have access to, such as via your ISP server.

The module's documentation shows how to point to an external SMTP server.
http://search.cpan.org/~rjbs/MIME-Lite-3.029/lib/MIME/Lite.pm#Change_how_messages_are_sent


zak100
Novice

Nov 2, 2013, 10:30 AM

Post #5 of 9 (765 views)
Re: [FishMonger] Free smtp server supporting perl [In reply to] Can't Post

Hi,
Thanks for your help and that document. I got the address of my ISP SMTP server. From the document i got:

Code
MIME::Lite->send('smtp','some.host', AuthUser=>$user, AuthPass=>$pass);

I cant understand where is the message and what is smtp?

Plz guide me.

Zulfi.


zak100
Novice

Nov 2, 2013, 10:48 AM

Post #6 of 9 (761 views)
Re: [zak100] Free smtp server supporting perl [In reply to] Can't Post

Hi,
I have got the follwoing code:

Code
 
#!/usr/bin/perl
use MIME::Lite;



my $theSubject = "test";

my $theData = "<h1>This is test email sent by Perl Script</h1>";

my $theEmail = MIME::Lite->new(
From =>'zulfi6000@yahoo.com',
To =>'zulfi6000@yahoo.com',
Subject =>$theSubject,
Data =>$theData
);

$theEmail->add( "Type" => "multipart/mixed" );

$theEmail->send( "smtp", "evodosmtp.ptcl.net.pk",'','' );


However i am getting following error:

Quote

D:\Zulfi\PERL MAIN FOLDER>perl email1.pl
SMTP Failed to connect to mail server: Invalid argument
at email1.pl line 19.


Kindly guide me.

Zulfi.


FishMonger
Veteran / Moderator

Nov 2, 2013, 11:22 AM

Post #7 of 9 (755 views)
Re: [zak100] Free smtp server supporting perl [In reply to] Can't Post

Did you pass your username and password?


Code
$theEmail->send( "smtp", "evodosmtp.ptcl.net.pk", AuthUser=>'username', AuthPass=>'password' );


Also remove this line and add it back when it's needed.

Code
$theEmail->add( "Type" => "multipart/mixed" );


Add this line near the beginning.

Code
$MIME::Lite::DEBUG = 1;



zak100
Novice

Nov 2, 2013, 10:29 PM

Post #8 of 9 (737 views)
Re: [FishMonger] Free smtp server supporting perl [In reply to] Can't Post

Hi,
I am now using gmail.com. My perl code is now:

Code
#!/usr/bin/perl 
use MIME::Lite;

$MIME::Lite::DEBUG = 1;

my $theSubject = "test";

my $theData = "<h1>This is test email sent by Perl Script</h1>";

my $theEmail = MIME::Lite->new(
From =>'zulfi6000@yahoo.com',
To =>'zulfi6000@yahoo.com',
Subject =>$theSubject,
Data =>$theData
);



$theEmail->send( "smtp", "smtp.gmail.com", AuthUser=>'username' , AuthPass=>'password');

I am getting following error:

Quote
D:\Zulfi\PERL MAIN FOLDER>perl email1.pl
SMTP auth() command not supported on smtp.gmail.com

D:\Zulfi\PERL MAIN FOLDER>


I have got the following link in this regard:

Quote
http://lifehacker.com/111166/how-to-use-gmail-as-your-smtp-server


Kindly guide. Thanks for your time.

Zulfi.


zak100
Novice

Nov 2, 2013, 10:49 PM

Post #9 of 9 (734 views)
Re: [zak100] Free smtp server supporting perl [In reply to] Can't Post

Hi,
I tried again with some with other smtp:

Code
#!/usr/bin/perl 
use MIME::Lite;

$MIME::Lite::DEBUG = 1;

my $theSubject = "test";

my $theData = "<h1>This is test email sent by Perl Script</h1>";

my $theEmail = MIME::Lite->new(
From =>'zulfi6000@yahoo.com',
To =>'zulfi6000@yahoo.com',
Subject =>$theSubject,
Data =>$theData
);

##smtp.ptcl.com.pk


$theEmail->send( "smtp", "smtp.ptcl.com", AuthUser=>'username' , AuthPass=>'password');


This time i got the following error:


Code
D:\Zulfi\PERL MAIN FOLDER>perl email1.pl 
SMTP Failed to connect to mail server: Bad file descriptor
at email1.pl line 20.

D:\Zulfi\PERL MAIN FOLDER>


Plz guide me.

Zulfi.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives