<?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>KhmerAK* &#124; All around Cambodia &#38; Technology &#187; Mailer</title>
	<atom:link href="http://khmerak.com/post/tag/mailer/feed/" rel="self" type="application/rss+xml" />
	<link>http://khmerak.com</link>
	<description>keep moving, keep hacking</description>
	<lastBuildDate>Mon, 31 May 2010 03:06:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Mailer Engine in Rails app</title>
		<link>http://khmerak.com/post/mailer-engine-in-rails-app/</link>
		<comments>http://khmerak.com/post/mailer-engine-in-rails-app/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 10:45:24 +0000</pubDate>
		<dc:creator>khmerak</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[Mailer]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://khmerak.com/post/mailer-engine-in-rails-app/</guid>
		<description><![CDATA[By having you application be able to send mail to its users is one of the most important feature that every apps should do and it&#8217;s also kinda basic stuff to setup too! Here&#8217;s a little note when you are doing it:
Normally from your rails app root:

1
$sudo script/generate mailer AppNotifier signup

This will add a signup [...]]]></description>
			<content:encoded><![CDATA[<p>By having you application be able to send mail to its users is one of the most important feature that every apps should do and it&#8217;s also kinda basic stuff to setup too! Here&#8217;s a little note when you are doing it:<br />
Normally from your rails app root:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">$sudo script/generate mailer AppNotifier signup</pre></td></tr></table></div>

<p>This will add a signup email notifier to your app. Then next step is just to do a little configuration to make it work, and how you want it to work.</p>
<p>In config/environment.rb , let&#8217;s add the mailer base so that your app will know which engine to send email out (normally it&#8217;s smtp setting)</p>
<p>Here&#8217;s if you use stmp server to send mail out: (put this stuff at the bottom of the file environment.rb)</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="language" style="font-family:monospace;"># Use this mailer to send Mail
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.server_settings = {
:address =&gt; &quot;mysmtp.server.com&quot;,
:port =&gt; 25,
:domain =&gt; &quot;appdoamin.com&quot;,
:authentication =&gt; :login,
:user_name =&gt; &quot;smtp_usr&quot;,
:password =&gt; &quot;secret&quot;,
}</pre></td></tr></table></div>

<p>But if your server is using sendmail function (mostly in Linux)</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">ActionMailer::Base.delivery_method = :sendmail
ActionMailer::Base.sendmail_settings = {
:location =&gt; '/usr/sbin/sendmail',
:arguments =&gt; '-i -t'}</pre></td></tr></table></div>

<p>If your server do not have sendmail, you can do it:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">$sudo apt-get install sendmail</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://khmerak.com/post/mailer-engine-in-rails-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
