<?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></description>
	<lastBuildDate>Sat, 06 Aug 2011 07:02:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<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>Yuanyi ZHANG</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将会拒绝发送。<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">无觅猜您也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.letrails.cn%2Farchives%2Fjavascript%25E5%25AE%259E%25E7%258E%25B0gmail%25E6%2597%25A0%25E5%2588%25B7%25E6%2596%25B0%25E6%2596%2587%25E4%25BB%25B6%25E4%25B8%258A%25E4%25BC%25A0%2F&from=http%3A%2F%2Fwww.letrails.cn%2Farchives%2Fusing-gmail-smtp-with-actionmailer%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript实现GMail无刷新文件上传</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.letrails.cn%2Farchives%2Fnginx_mongrel_cluster_deployment%2F&from=http%3A%2F%2Fwww.letrails.cn%2Farchives%2Fusing-gmail-smtp-with-actionmailer%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">nginx+mongrel cluster配置指南</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.letrails.cn%2Farchives%2Frails-3-beta-multibyte-email-garbled%2F&from=http%3A%2F%2Fwww.letrails.cn%2Farchives%2Fusing-gmail-smtp-with-actionmailer%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Rails 3 beta 中文邮件乱码问题解决</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.letrails.cn%2Farchives%2F32%2F&from=http%3A%2F%2Fwww.letrails.cn%2Farchives%2Fusing-gmail-smtp-with-actionmailer%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">RailsLogVisualizer现在支持Windows</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></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>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">无觅猜您也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.letrails.cn%2Farchives%2Fjavascript%25E5%25AE%259E%25E7%258E%25B0gmail%25E6%2597%25A0%25E5%2588%25B7%25E6%2596%25B0%25E6%2596%2587%25E4%25BB%25B6%25E4%25B8%258A%25E4%25BC%25A0%2F&from=http%3A%2F%2Fwww.letrails.cn%2Farchives%2Fusing-gmail-smtp-with-actionmailer%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript实现GMail无刷新文件上传</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.letrails.cn%2Farchives%2Fnginx_mongrel_cluster_deployment%2F&from=http%3A%2F%2Fwww.letrails.cn%2Farchives%2Fusing-gmail-smtp-with-actionmailer%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">nginx+mongrel cluster配置指南</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.letrails.cn%2Farchives%2Frails-3-beta-multibyte-email-garbled%2F&from=http%3A%2F%2Fwww.letrails.cn%2Farchives%2Fusing-gmail-smtp-with-actionmailer%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Rails 3 beta 中文邮件乱码问题解决</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.letrails.cn%2Farchives%2F15%2F&from=http%3A%2F%2Fwww.letrails.cn%2Farchives%2Fusing-gmail-smtp-with-actionmailer%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">NetBeans IDE: Windows平台最好的Ruby IDE</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></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>

