LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Perl and Gmail SMTP (https://www.linuxquestions.org/questions/programming-9/perl-and-gmail-smtp-717677/)

the_imax 04-08-2009 06:57 AM

Perl and Gmail SMTP
 
Which module we need for sending email via Gmail SMTP in perl ?

Net::SMTP::TLS or Net::SMTP::SSL


here are gmail smtp requirements

http://mail.google.com/support/bin/a...n&answer=13287

datopdog 04-08-2009 07:43 AM

Net::SMTP::SSL is the one to use since gmail requires you to use a submission port (465 or 587).

Net::SMTP::TLS could be used if gmail was allowing connections to port 25 with STARTTLS

the_imax 04-08-2009 03:31 PM

Thanks, I tried and it also worked with the TLS module, now the problem is that email being received at other end is containing two Received headers and is being marked as spam by Yahoo/hotmail etc

Normal email that I send from Gmail using web only contains one Received header with from/to info and I guess the duplicate headers are causing problems with the spam filters ( you can see that the 2nd received from/to combination shows my server address which connected to Gmail's smtp)

Is it normal to have more than 1 received header while sending email from SMTP with authentication or am I doing something wrong here?





Code:

Return-Path:                    <admin@testtest.com>
Authentication-Results:                mta107.mail.re1.yahoo.com from=testtest.com; domainkeys=neutral (no sig); from=testtest.com; dkim=neutral (no sig)
Received:                from 74.125.92.145 (EHLO qw-out-1920.google.com) (74.125.92.145) by mta107.mail.re1.yahoo.com with SMTP; Wed, 08 Apr 2009 12:02:07 -0700
Received:                by qw-out-1920.google.com with SMTP id 9so188509qwj.14 for <me@yahoo.com>; Wed, 08 Apr 2009 12:02:07 -0700 (PDT)
Received:                by 10.224.53.199 with SMTP id n7mrww44855qag.196.1239217327764; Wed, 08 Apr 2009 12:02:07 -0700 (PDT)
Return-Path:                <admin@testtest.com>
Received:                from smtp.gmail.com (server40.myhost.com [167.125.179.141]) by mx.google.com with ESMTPS id 3sd173936sdfy.12.2009.04.08.12.02.06 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 08 Apr 2009 12:02:06 -0700 (PDT)
Message-ID:                <49dcf4aes.9asdcd.61bf.ffsczxcdd11@mx.google.com>
Date:                Wed, 08 Apr 2009 12:02:06 -0700 (PDT)
MIME-Version:                1.0
Content-Type:                text/html; charset=ISO-8859-1
Content-Transfer-Encoding:                7bit
To:                me@yahoo.com
From:               
"admin@testtest.com" <admin@testtest.com> 
Add sender to Contacts
Subject:                testing
Content-Length:                581


datopdog 04-09-2009 06:33 AM

The headers are normal they show the path the email was transmitted through.


All times are GMT -5. The time now is 02:28 PM.