<?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>killianfaughnan.com &#187; mailer</title>
	<atom:link href="http://killianfaughnan.com/tag/mailer/feed/" rel="self" type="application/rss+xml" />
	<link>http://killianfaughnan.com</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Wed, 23 Feb 2011 09:05:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Mailer Shell Script</title>
		<link>http://killianfaughnan.com/2008/11/20/mailer-shell-script/</link>
		<comments>http://killianfaughnan.com/2008/11/20/mailer-shell-script/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 15:29:36 +0000</pubDate>
		<dc:creator>kfaughnan</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[mailer]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://killianfaughnan.com/?p=91</guid>
		<description><![CDATA[This script uses the Unix mailx program to send a pre-scripted email to someone. It will take in an email address on the command line as an argument and send the mail to this address. Just copy and paste this into a file named mailerscript and change the file permissions to 755 and then your [...]]]></description>
			<content:encoded><![CDATA[<p>This script uses the Unix mailx program to send a pre-scripted email to someone. It will take in an email address on the command line as an argument and send the mail to this address. Just copy and paste this into a file named mailerscript and change the file permissions to 755 and then your on your way! You can see how to change the permissions <a title="Ubuntu Chmod" href="http://manpages.ubuntu.com/manpages/jaunty/en/man1/chmod.1posix.html" target="_blank">here</a> if your unsure.</p>
<p>In order to run the script just use the command</p>
<pre>  $ ./mailerscript user@example.com</pre>
<p>where user@example.com is the email address you wish the mail to go to.</p>
<pre>#!/bin/sh
# Usage: mailerscript &lt;email address&gt;

if [ $1 ]; then

FILE=/tmp/mailerscript-$UID.txt
echo "Emailing $1...";

echo "
Hi,

This script will send an email to someone taking in a single argument.
You can take in as many as you want though.

Killian

" &gt;$FILE

mail -s "Scripted mail sent" $1 -c user@example.com &lt; $FILE
rm $FILE

else
 echo "Usage: mailerscript &lt;email address&gt;"
fi</pre>
]]></content:encoded>
			<wfw:commentRss>http://killianfaughnan.com/2008/11/20/mailer-shell-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

