LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-08-2009, 06:57 AM   #1
the_imax
Member
 
Registered: Apr 2004
Distribution: RHEL 4/ CentOS
Posts: 159

Rep: Reputation: 30
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
 
Old 04-08-2009, 07:43 AM   #2
datopdog
Member
 
Registered: Feb 2008
Location: JHB South Africa
Distribution: Centos, Kubuntu, Cross LFS, OpenSolaris
Posts: 806

Rep: Reputation: 41
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
 
Old 04-08-2009, 03:31 PM   #3
the_imax
Member
 
Registered: Apr 2004
Distribution: RHEL 4/ CentOS
Posts: 159

Original Poster
Rep: Reputation: 30
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

Last edited by the_imax; 04-08-2009 at 03:34 PM.
 
Old 04-09-2009, 06:33 AM   #4
datopdog
Member
 
Registered: Feb 2008
Location: JHB South Africa
Distribution: Centos, Kubuntu, Cross LFS, OpenSolaris
Posts: 806

Rep: Reputation: 41
The headers are normal they show the path the email was transmitted through.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with perl sending email with Gmail SMTP sadarax Programming 3 09-12-2009 07:17 PM
PHP SMTP connection to gmail SMTP protocol violation ratcateme Programming 9 02-23-2009 03:58 AM
nbsmtp cannoct connect to Gmail SMTP, but Evolution can? why? mutable Linux - Newbie 0 11-28-2007 03:05 PM
exim4 sends with smtp.gmail.com otoomet LinuxQuestions.org Member Success Stories 0 09-10-2007 11:22 PM
Perl Net::SMTP::TLS (using downloaded modules) sadarax Programming 2 07-28-2007 03:32 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration