Forum Moderators: coopster & phranque

Message Too Old, No Replies

problem with Perl Mail::Sendmail from Window Vista

         

jscjso

12:54 am on Apr 19, 2008 (gmt 0)

10+ Year Member



I recently purchased a new computer, it comes with Vista.
I have set up WindowMail as client in my computer to link with Gmail. It works fine.

Then I started to write some Perl/HTML scripts with Mail::Sendmail, however, I cannot find any test mail reaching my target gmail account. I think my problem is to set the right smtp path.

I checked my WindowMail setup, I have outgoing mail(SMTP) as
smtp.gmail.com.

So I used smtp.gmail.com in my Mail::sendmail Perl script as:

use strict;
use Mail::Sendmail;

my $to_list = '#*$!xx@gmail.com';
my $cc_list = '#*$!xx@gmail.com';
my $email = "\n\nThis email was generated automatically.\n";
my $MailFrom = '#*$!xx@gmail.com';
my $subject = "hello test";
my $message = "module test";

sendmail( Smtp => 'smtp.gmail.com', From => $MailFrom, To =>
$to_list,
Cc => $cc_list, Subject => $subject, Message => $message,);

where #*$!x is my gmail email account address.

There is no error message when I executed this, but I checked my gmail account and there is no email reaching there.

I have copied the Sendmail.pm from CPAN to my c:\Perl\site\lib\Mail,
I tested this setup and it should work. When I rename this Sendmail.pm, my Perl script errors out.

My computer is hooked to Verizon internet service, I do not have any
Domain setup. My internet connection is just a regular home
connection.

Actually I have no clue what is wrong, my guess is just the smtp
setting. How do I find out what smtp path should I use. Or any other
problem anyone can thinking of.

rocknbil

4:02 pm on Apr 19, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, mail has always been a bit of a "black box" to me, but it's very probable that gmail is simply not allowing an external computer to use it's service to send mail. Think about it, if this were the case, spamming would be so much easier, anyone could connect to gmail and send mail.

Given your scenario, I am GUESSING that you would have to set up your own mail server on your local machine and use that as your smtp. Have you tried moving this script into a hosting environment with a mail server already in place?

jscjso

9:16 pm on Apr 19, 2008 (gmt 0)

10+ Year Member



Rocknbil,

Thanks for a quick reply.

I have setup an account in Yahoo.geocity, but I did not spend
time to make the cgi running there even it said it does.
I downloaded Abyss server in my own computer to test run all my
scripts and it is very convience to do all these in my own directories.

I have not thought about mail server, let me look at Abyss server X1 to see whether it supports mail.

Thanks,
jscjso

chorny

10:23 pm on May 8, 2008 (gmt 0)

10+ Year Member



jscjso, AFAIK GMail uses encrypted connection - maybe you need additional modules for that.