<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Sending Mail Through Gmail with Perl</title>
	<atom:link href="http://www.nixtutor.com/linux/sending-mail-through-gmail-with-perl/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nixtutor.com/linux/sending-mail-through-gmail-with-perl/</link>
	<description>Helping you Learn Linux</description>
	<lastBuildDate>Sun, 14 Feb 2010 17:54:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Sawyer</title>
		<link>http://www.nixtutor.com/linux/sending-mail-through-gmail-with-perl/comment-page-1/#comment-617</link>
		<dc:creator>Sawyer</dc:creator>
		<pubDate>Sun, 12 Jul 2009 08:32:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.nixtutor.com/?p=990#comment-617</guid>
		<description>I like to use Email::Stuff for email handling. It uses Email::Send in the backend and I can just write it as so: ) (hope the aligning looks right)
Email::Stuff-&gt;from      ($from   )
            -&gt;to        ($to     )
            -&gt;subject   ($subject)
            -&gt;text_body ( $text  )
            -&gt;using( &#039;Gmail&#039;, username =&gt; $user, password =&gt; $pass )
            -&gt;send;

However, Email::Send::Gmail doesn&#039;t play nice with Email::Stuff. Specifically the subroutine get_env_sender(). So, to fix it, I add the following line to my code prior to sending the email:
local *Email::Send::Gmail::get_env_sender = sub { };</description>
		<content:encoded><![CDATA[<p>I like to use Email::Stuff for email handling. It uses Email::Send in the backend and I can just write it as so: ) (hope the aligning looks right)<br />
Email::Stuff-&gt;from      ($from   )<br />
            -&gt;to        ($to     )<br />
            -&gt;subject   ($subject)<br />
            -&gt;text_body ( $text  )<br />
            -&gt;using( &#8216;Gmail&#8217;, username =&gt; $user, password =&gt; $pass )<br />
            -&gt;send;</p>
<p>However, Email::Send::Gmail doesn&#8217;t play nice with Email::Stuff. Specifically the subroutine get_env_sender(). So, to fix it, I add the following line to my code prior to sending the email:<br />
local *Email::Send::Gmail::get_env_sender = sub { };</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Sanborn</title>
		<link>http://www.nixtutor.com/linux/sending-mail-through-gmail-with-perl/comment-page-1/#comment-565</link>
		<dc:creator>Mark Sanborn</dc:creator>
		<pubDate>Tue, 07 Jul 2009 15:38:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.nixtutor.com/?p=990#comment-565</guid>
		<description>You gotta love cpan :)</description>
		<content:encoded><![CDATA[<p>You gotta love cpan <img src='http://www.nixtutor.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leon Brocard</title>
		<link>http://www.nixtutor.com/linux/sending-mail-through-gmail-with-perl/comment-page-1/#comment-564</link>
		<dc:creator>Leon Brocard</dc:creator>
		<pubDate>Tue, 07 Jul 2009 06:46:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.nixtutor.com/?p=990#comment-564</guid>
		<description>Or, you could use the module on CPAN which does this for you and makes it easy to create emails too: Email::Send::Gmail

http://search.cpan.org/dist/Email-Send-Gmail/

#!/usr/bin/perl
  use strict;
  use warnings;
  use Email::Send;
  use Email::Send::Gmail;
  use Email::Simple::Creator;

  my $email = Email::Simple-&gt;create(
      header =&gt; [
          From    =&gt; &#039;magic_monitoring@gmail.com&#039;,
          To      =&gt; &#039;acme@astray.com&#039;,
          Subject =&gt; &#039;Server down&#039;,
      ],
      body =&gt; &#039;The server is down. Start panicing.&#039;,
  );

  my $sender = Email::Send-&gt;new(
      {   mailer      =&gt; &#039;Gmail&#039;,
          mailer_args =&gt; [
              username =&gt; &#039;magic_monitoring@gmail.com&#039;,
              password =&gt; &#039;XXX&#039;,
          ]
      }
  );
  eval { $sender-&gt;send($email) };
  die &quot;Error sending email: $@&quot; if $@;</description>
		<content:encoded><![CDATA[<p>Or, you could use the module on CPAN which does this for you and makes it easy to create emails too: Email::Send::Gmail</p>
<p><a href="http://search.cpan.org/dist/Email-Send-Gmail/" rel="nofollow">http://search.cpan.org/dist/Email-Send-Gmail/</a></p>
<p>#!/usr/bin/perl<br />
  use strict;<br />
  use warnings;<br />
  use Email::Send;<br />
  use Email::Send::Gmail;<br />
  use Email::Simple::Creator;</p>
<p>  my $email = Email::Simple-&gt;create(<br />
      header =&gt; [<br />
          From    =&gt; 'magic_monitoring@gmail.com',<br />
          To      =&gt; 'acme@astray.com',<br />
          Subject =&gt; 'Server down',<br />
      ],<br />
      body =&gt; &#8216;The server is down. Start panicing.&#8217;,<br />
  );</p>
<p>  my $sender = Email::Send-&gt;new(<br />
      {   mailer      =&gt; &#8216;Gmail&#8217;,<br />
          mailer_args =&gt; [<br />
              username =&gt; 'magic_monitoring@gmail.com',<br />
              password =&gt; 'XXX',<br />
          ]<br />
      }<br />
  );<br />
  eval { $sender-&gt;send($email) };<br />
  die &#8220;Error sending email: $@&#8221; if $@;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
