<?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: How to send SMTP mail in Ruby using ActionMailer (outside Rails)</title>
	<atom:link href="http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/</link>
	<description>Random braindumps vaguely related to coding</description>
	<lastBuildDate>Thu, 12 Aug 2010 06:21:32 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Greg Ditrick</title>
		<link>http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/comment-page-1/#comment-7896</link>
		<dc:creator>Greg Ditrick</dc:creator>
		<pubDate>Tue, 06 Oct 2009 17:16:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/#comment-7896</guid>
		<description>Okay, I have tried this without setting

Action::Base.template_root = &quot;some path&quot;

and it does not work!  It is complaining that it can not find the template file and I can not set it.

Appreciate any help here?

GregD</description>
		<content:encoded><![CDATA[<p>Okay, I have tried this without setting</p>
<p>Action::Base.template_root = &#8220;some path&#8221;</p>
<p>and it does not work!  It is complaining that it can not find the template file and I can not set it.</p>
<p>Appreciate any help here?</p>
<p>GregD</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Ditrick</title>
		<link>http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/comment-page-1/#comment-7895</link>
		<dc:creator>Greg Ditrick</dc:creator>
		<pubDate>Tue, 06 Oct 2009 16:25:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/#comment-7895</guid>
		<description>When I try to set

ActionMailer::Base.template_root = 

I&#039;m getting the following error:

activesupport-2.3.4/lib/active_support/dependencies.rb:105:in `rescue in const_missing&#039;: uninitialized constant ActionView::Base::ActionController (NameError)


Any ideas?

Do I have to set the template_root?  Googling I found that I have to but you are not.  Where does it find the templates if you are not setting it?

I&#039;m trying to use sendmail instead of smtp.</description>
		<content:encoded><![CDATA[<p>When I try to set</p>
<p>ActionMailer::Base.template_root = </p>
<p>I&#8217;m getting the following error:</p>
<p>activesupport-2.3.4/lib/active_support/dependencies.rb:105:in `rescue in const_missing&#8217;: uninitialized constant ActionView::Base::ActionController (NameError)</p>
<p>Any ideas?</p>
<p>Do I have to set the template_root?  Googling I found that I have to but you are not.  Where does it find the templates if you are not setting it?</p>
<p>I&#8217;m trying to use sendmail instead of smtp.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Smith</title>
		<link>http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/comment-page-1/#comment-7667</link>
		<dc:creator>Andrew Smith</dc:creator>
		<pubDate>Wed, 23 Sep 2009 18:26:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/#comment-7667</guid>
		<description>Thanks for the instructions, they worked like a charm! :-)</description>
		<content:encoded><![CDATA[<p>Thanks for the instructions, they worked like a charm! <img src='http://www.rawblock.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hasmukh</title>
		<link>http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/comment-page-1/#comment-110</link>
		<dc:creator>Hasmukh</dc:creator>
		<pubDate>Fri, 21 Dec 2007 13:41:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/#comment-110</guid>
		<description>Can u tell me how can we schedule email using action mailer? According to this mail is going, no problem. But i want to schedule means i want to set date and time to send mail.
Thanks.</description>
		<content:encoded><![CDATA[<p>Can u tell me how can we schedule email using action mailer? According to this mail is going, no problem. But i want to schedule means i want to set date and time to send mail.<br />
Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mohamed</title>
		<link>http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/comment-page-1/#comment-100</link>
		<dc:creator>mohamed</dc:creator>
		<pubDate>Sun, 21 Oct 2007 19:30:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/#comment-100</guid>
		<description>Actually this program is  working fine in Windows but not in Linux (CentOS 4.0 or newer),It throws an error like uninitialized constant ActionController::Base&lt;br/&gt;&lt;br/&gt;Can anybody tell me what is the problem with that?</description>
		<content:encoded><![CDATA[<p>Actually this program is  working fine in Windows but not in Linux (CentOS 4.0 or newer),It throws an error like uninitialized constant ActionController::Base</p>
<p>Can anybody tell me what is the problem with that?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Outta</title>
		<link>http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/comment-page-1/#comment-97</link>
		<dc:creator>Outta</dc:creator>
		<pubDate>Mon, 01 Oct 2007 14:01:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/#comment-97</guid>
		<description>Thank you!</description>
		<content:encoded><![CDATA[<p>Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julian Doherty</title>
		<link>http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/comment-page-1/#comment-94</link>
		<dc:creator>Julian Doherty</dc:creator>
		<pubDate>Sat, 29 Sep 2007 00:10:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/#comment-94</guid>
		<description>Outta - It&#039;s a little more complicated. Using ActionMailer, you would need to set up an .rhtml template, and set the content type of the message to text/html (not the attachment as I&#039;ve done here).&lt;br/&gt;&lt;br/&gt;Check out http://api.rubyonrails.com/classes/ActionMailer/Base.html for more info.</description>
		<content:encoded><![CDATA[<p>Outta &#8211; It&#8217;s a little more complicated. Using ActionMailer, you would need to set up an .rhtml template, and set the content type of the message to text/html (not the attachment as I&#8217;ve done here).</p>
<p>Check out <a href="http://api.rubyonrails.com/classes/ActionMailer/Base.html" rel="nofollow">http://api.rubyonrails.com/classes/ActionMailer/Base.html</a> for more info.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Outta</title>
		<link>http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/comment-page-1/#comment-93</link>
		<dc:creator>Outta</dc:creator>
		<pubDate>Fri, 28 Sep 2007 20:27:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/#comment-93</guid>
		<description>Great article has helped me quite a bit.  I have a question though, how could I get this to work so it would send  link in the body of the email instead of an attachment?&lt;br/&gt;&lt;br/&gt;I&#039;m looking to do something like &lt;a HREF=&quot;http://linkSomewhere&quot; REL=&quot;nofollow&quot;&gt;link&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;I can get http://linkSomewhere in the e-mail but when I add any tags it just becomes regular text.&lt;br/&gt;&lt;br/&gt;Thanks for any help&lt;br/&gt;&lt;br/&gt;Ray</description>
		<content:encoded><![CDATA[<p>Great article has helped me quite a bit.  I have a question though, how could I get this to work so it would send  link in the body of the email instead of an attachment?</p>
<p>I&#8217;m looking to do something like <a HREF="http://linkSomewhere" REL="nofollow">link</a></p>
<p>I can get <a href="http://linkSomewhere" rel="nofollow">http://linkSomewhere</a> in the e-mail but when I add any tags it just becomes regular text.</p>
<p>Thanks for any help</p>
<p>Ray</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julian Doherty</title>
		<link>http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/comment-page-1/#comment-78</link>
		<dc:creator>Julian Doherty</dc:creator>
		<pubDate>Thu, 02 Aug 2007 12:40:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/#comment-78</guid>
		<description>Great. Glad to help out Gunnar :)&lt;br/&gt;&lt;br/&gt;The other ways to get rubygems working, is to start ruby with the -rubygems argument, or to export RUBYOPT=rubygems as an environment variable.</description>
		<content:encoded><![CDATA[<p>Great. Glad to help out Gunnar <img src='http://www.rawblock.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The other ways to get rubygems working, is to start ruby with the -rubygems argument, or to export RUBYOPT=rubygems as an environment variable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gunnar Widell</title>
		<link>http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/comment-page-1/#comment-77</link>
		<dc:creator>Gunnar Widell</dc:creator>
		<pubDate>Thu, 02 Aug 2007 10:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/#comment-77</guid>
		<description>Thanks for your help Julian,&lt;br/&gt;&lt;br/&gt;I had to do a require &#039;rubygems&#039; as well.&lt;br/&gt;&lt;br/&gt;I now have a working send .jpg script! I also have mail notification via SMS, when the e-mail arrives...&lt;br/&gt;&lt;br/&gt;Remaining:&lt;br/&gt;crontab job that scans for new .jpg, and send the mail. Or, scan for .jpg, send e-mail, move .jpg to archive.&lt;br/&gt;&lt;br/&gt;This is great!</description>
		<content:encoded><![CDATA[<p>Thanks for your help Julian,</p>
<p>I had to do a require &#8216;rubygems&#8217; as well.</p>
<p>I now have a working send .jpg script! I also have mail notification via SMS, when the e-mail arrives&#8230;</p>
<p>Remaining:<br />crontab job that scans for new .jpg, and send the mail. Or, scan for .jpg, send e-mail, move .jpg to archive.</p>
<p>This is great!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julian Doherty</title>
		<link>http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/comment-page-1/#comment-76</link>
		<dc:creator>Julian Doherty</dc:creator>
		<pubDate>Wed, 01 Aug 2007 21:59:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/#comment-76</guid>
		<description>For the SMTP auth to work, http://am.rubyonrails.com/classes/ActionMailer/Base.html has the details on how ActionMailer can be configured.&lt;br/&gt;&lt;br/&gt;Basically, in the smtp_settings call in the original example, you&#039;d want to pass in values for :domain, :user_name, :password, and possibly :authentication</description>
		<content:encoded><![CDATA[<p>For the SMTP auth to work, <a href="http://am.rubyonrails.com/classes/ActionMailer/Base.html" rel="nofollow">http://am.rubyonrails.com/classes/ActionMailer/Base.html</a> has the details on how ActionMailer can be configured.</p>
<p>Basically, in the smtp_settings call in the original example, you&#8217;d want to pass in values for :domain, :user_name, :password, and possibly :authentication</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julian Doherty</title>
		<link>http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/comment-page-1/#comment-75</link>
		<dc:creator>Julian Doherty</dc:creator>
		<pubDate>Wed, 01 Aug 2007 21:55:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/#comment-75</guid>
		<description>Hi Gunnar&lt;br/&gt;&lt;br/&gt;This example just does the mailing part. It&#039;s not too hard to call it from other code that does the work assembling the file list.&lt;br/&gt;&lt;br/&gt;In the case where I&#039;m using this, the code to manipulate the files would look something like&lt;br/&gt;&lt;br/&gt;#start here&lt;br/&gt;files_to_email = Dir[&#039;/home/juliand/to_email/*.jpg&#039;]&lt;br/&gt;to = &#039;some.address@example.com&#039;&lt;br/&gt;from = &#039;julian@example.com&#039;&lt;br/&gt;mime_type = &#039;image/jpeg&#039;&lt;br/&gt;files_to_email.each do &#124;f&#124; &lt;br/&gt; FileMailer.deliver_file(to, from, f, mime_type)&lt;br/&gt;end&lt;br/&gt;#end here&lt;br/&gt;&lt;br/&gt;(I think the format will get messed up by the comments system, but you get the idea)&lt;br/&gt;&lt;br/&gt;To get it to pick up all files in a directory whenever they arrive, you&#039;d probably want to set up a cron job, or start a permanent ruby  process running in the background. You&#039;d need to write some extra code to periodically check for any files, email then, then move them to an archive directory (so they aren&#039;t picked up the next time).&lt;br/&gt;&lt;br/&gt;Hope this helps.</description>
		<content:encoded><![CDATA[<p>Hi Gunnar</p>
<p>This example just does the mailing part. It&#8217;s not too hard to call it from other code that does the work assembling the file list.</p>
<p>In the case where I&#8217;m using this, the code to manipulate the files would look something like</p>
<p>#start here<br />files_to_email = Dir['/home/juliand/to_email/*.jpg']<br />to = &#8217;some.address@example.com&#8217;<br />from = &#8216;julian@example.com&#8217;<br />mime_type = &#8216;image/jpeg&#8217;<br />files_to_email.each do |f| <br /> FileMailer.deliver_file(to, from, f, mime_type)<br />end<br />#end here</p>
<p>(I think the format will get messed up by the comments system, but you get the idea)</p>
<p>To get it to pick up all files in a directory whenever they arrive, you&#8217;d probably want to set up a cron job, or start a permanent ruby  process running in the background. You&#8217;d need to write some extra code to periodically check for any files, email then, then move them to an archive directory (so they aren&#8217;t picked up the next time).</p>
<p>Hope this helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/comment-page-1/#comment-74</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Wed, 01 Aug 2007 12:36:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.rawblock.com/2007/07/31/how-to-send-smtp-mail-in-ruby-using-actionmailer-outside-rails/#comment-74</guid>
		<description>Hi Julian,&lt;br/&gt;Just found your post with google. I am new into programming, and new to ruby as well.&lt;br/&gt;&lt;br/&gt;I am trying to use your example as a standalone tool to send all .jpg files from a directory. I have not succeeded yet, still installing some gems.&lt;br/&gt;&lt;br/&gt;Any more ideas how to make this automatic, when a new.jpg file shows up in a directory, sent it via e-mail directly. &lt;br/&gt;&lt;br/&gt;Need to get the &quot;smtp relay&quot; with auth to work as well via my ISPs servers.&lt;br/&gt;&lt;br/&gt;This will be used for my the surveillance cameras in my summer house...&lt;br/&gt;&lt;br/&gt;Regards&lt;br/&gt;Gunnar&lt;br/&gt;Stockholm</description>
		<content:encoded><![CDATA[<p>Hi Julian,<br />Just found your post with google. I am new into programming, and new to ruby as well.</p>
<p>I am trying to use your example as a standalone tool to send all .jpg files from a directory. I have not succeeded yet, still installing some gems.</p>
<p>Any more ideas how to make this automatic, when a new.jpg file shows up in a directory, sent it via e-mail directly. </p>
<p>Need to get the &#8220;smtp relay&#8221; with auth to work as well via my ISPs servers.</p>
<p>This will be used for my the surveillance cameras in my summer house&#8230;</p>
<p>Regards<br />Gunnar<br />Stockholm</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.252 seconds -->
