Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Banned
    Join Date
    Oct 2013
    Posts
    15
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Problem with sending email using MIME Lite

    Hi,
    I have written the following perl code to send email:


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

    $MIME::Lite:EBUG = 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');



    However its not working and i am getting following errors:
    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>
    Somebody plz help me in this regard. I am working on windows 7.

    Zulfi.

  • #2
    Super Moderator
    Join Date
    May 2005
    Location
    Southern tip of Silicon Valley
    Posts
    2,838
    Thanks
    2
    Thanked 160 Times in 155 Posts
    Here's the result of a port scan of that server.
    D:\test>nmap -p 25 smtp.ptcl.com

    Starting Nmap 5.21 ( http://nmap.org ) at 2013-11-03 07:29 Pacific Standard Time
    Nmap scan report for smtp.ptcl.com (208.87.35.103)
    Host is up (0.14s latency).
    rDNS record for 208.87.35.103: 208-87-35-103.securehost.com
    PORT STATE SERVICE
    25/tcp filtered smtp

    Nmap done: 1 IP address (1 host up) scanned in 13.09 seconds
    That means that the smpt port 25 is blocked by firewall rules. It may be that they only allow users from specific outside IP addresses to send email through it, or that they only allow emails from hosts within their local network.

    If that is your ISP or your company's smtp server, then you'll need to contact their tech support to find if you are allowed to send emails through that server.

    Also, using a yahoo address for the FROM (source) address will be problematic when sending emails out through any non yahoo server.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •