<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>LetRails &#187; 邮件</title>
	<atom:link href="http://www.letrails.cn/archives/category/%e9%82%ae%e4%bb%b6/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.letrails.cn</link>
	<description>为Ruby on Rails在中文社区的枝繁叶茂贡献点滴</description>
	<lastBuildDate>Sat, 04 Sep 2010 08:24:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>配置ActionMailer使用GMail发送邮件</title>
		<link>http://www.letrails.cn/archives/using-gmail-smtp-with-actionmailer/</link>
		<comments>http://www.letrails.cn/archives/using-gmail-smtp-with-actionmailer/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 12:13:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[邮件]]></category>

		<guid isPermaLink="false">http://www.letrails.cn/archives/using-gmail-smtp-with-actionmailer</guid>
		<description><![CDATA[这个问题由来已久，比较了一下几种现有的解决方案，最后发现Robert Bousquet的方案是最简单的。 1. Robert只提供了一个源码下载链接，不是很方便，我将它放到了github上： $ script/plugin install git://github.com/yzhang/smtp_tls.git 2. 修改environment.rb: require "smtp_tls" mailer_config = File.open("#{RAILS_ROOT}/config/mailer.yml") mailer_options = YAML.load(mailer_config) ActionMailer::Base.smtp_settings = mailer_options 3. 建立config/mailer.yml &#8212; &#160; :address: smtp.gmail.com &#160; :port: 587 &#160; :user_name: john@doe.com &#160; :password: s1j234gh &#160; :authentication: :plain 4. 如果你使用了ExceptionNotification插件，那么你需要确保ExceptionNotification的发件人设置与你的Gmail帐户相符，否则GMail将会拒绝发送。]]></description>
			<content:encoded><![CDATA[<p>这个问题由来已久，比较了一下几种现有的解决方案，最后发现<a href="mailto:robert@robertbousquet.com" style="margin: 0pt">Robert Bousquet</a>的方案是最简单的。</p>
<p>1. Robert只提供了一个源码下载链接，不是很方便，我将它放到了github上：</li>
<p class="code"><code><br />
$ script/plugin install git://github.com/yzhang/smtp_tls.git<br />
</code></p>
<p>2. 修改environment.rb:</p>
<p class="code"><code class="ruby"><br />
require "smtp_tls"<br />
mailer_config = File.open("#{RAILS_ROOT}/config/mailer.yml")<br />
mailer_options = YAML.load(mailer_config)<br />
ActionMailer::Base.smtp_settings = mailer_options<br />
</code></p>
<p>3. 建立config/mailer.yml</p>
<p>&#8212;<br />
&nbsp; :address: smtp.gmail.com<br />
&nbsp; :port: 587<br />
&nbsp; :user_name: john@doe.com<br />
&nbsp; :password: s1j234gh<br />
&nbsp; :authentication: :plain</p>
<p>4. 如果你使用了ExceptionNotification插件，那么你需要确保ExceptionNotification的发件人设置与你的Gmail帐户相符，否则GMail将会拒绝发送。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.letrails.cn/archives/using-gmail-smtp-with-actionmailer/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
