<?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>www.Senthoor.info &#187; PHP</title>
	<atom:link href="http://senthoor.info/blogs/category/tutorials/server-scripting/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://senthoor.info/blogs</link>
	<description></description>
	<lastBuildDate>Fri, 10 Oct 2008 12:37:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Send Mail through php</title>
		<link>http://senthoor.info/blogs/2007/10/16/send-mail-through-php/</link>
		<comments>http://senthoor.info/blogs/2007/10/16/send-mail-through-php/#comments</comments>
		<pubDate>Tue, 16 Oct 2007 06:59:12 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://senthoor.info/blogs/?p=8</guid>
		<description><![CDATA[Sending mail text format
&#60;?php
// The message
$message = &#8220;Line 1\nLine 2\nLine 3&#8243;;
// In case any of our lines are larger than 70 characters, we should use wordwrap()
$message = wordwrap($message, 70);
// Send
mail(&#8217;webmaster@example.com&#8217;, &#8216;My Subject&#8217;, $message);
?&#62;
Sending mail with extra headers.
&#60;?php
$to      = &#8216;nobody@example.com&#8217;;
$subject = &#8216;the subject&#8217;;
$message = &#8216;hello&#8217;;
$headers = &#8216;From: &#160;webmaster at example.com\&#8217; . &#8220;\r\n&#8221; .
&#8216;Reply-To: &#160;webmaster at example.com\&#8217; [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Sending mail text format</strong></p>
<blockquote><p><em>&lt;?php</em><br />
<em>// The message</em><br />
<em>$message = &#8220;Line 1\nLine 2\nLine 3&#8243;;</em></p>
<p><em>// In case any of our lines are larger than 70 characters, we should use wordwrap()</em><br />
<em>$message = wordwrap($message, 70);</em></p>
<p><em>// Send</em><br />
<em>mail(&#8217;webmaster@example.com&#8217;, &#8216;My Subject&#8217;, $message);</em><br />
<em>?&gt;</em></p></blockquote>
<p><strong>Sending mail with extra headers.</strong></p>
<blockquote><p>&lt;?php<br />
$to      = &#8216;nobody@example.com&#8217;;<br />
$subject = &#8216;the subject&#8217;;<br />
$message = &#8216;hello&#8217;;<br />
$headers = &#8216;From: &nbsp;<a href="mailto:webmaster@example.com'" title="mailto:webmaster@example.com'">webmaster at example.com\&#8217;</a> . &#8220;\r\n&#8221; .<br />
&#8216;Reply-To: &nbsp;<a href="mailto:webmaster@example.com'" title="mailto:webmaster@example.com'">webmaster at example.com\&#8217;</a> . &#8220;\r\n&#8221; .<br />
&#8216;X-Mailer: PHP/&#8217; . phpversion();</p>
<p>mail($to, $subject, $message, $headers);<br />
?&gt;</p></blockquote>
<p><strong>Sending HTML email</strong></p>
<blockquote><p>&lt;?php<br />
// multiple recipients<br />
$to  = &#8216;aidan@example.com&#8217; . &#8216;, &#8216;; // note the comma<br />
$to .= &#8216;wez@example.com&#8217;;</p>
<p>// subject<br />
$subject = &#8216;Birthday Reminders for August&#8217;;</p>
<p>// message<br />
$message = &#8216;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Birthday Reminders for August&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;p&gt;Here are the birthdays upcoming in August!&lt;/p&gt;<br />
&lt;table&gt;<br />
&lt;tr&gt;<br />
&lt;th&gt;Person&lt;/th&gt;&lt;th&gt;Day&lt;/th&gt;&lt;th&gt;Month&lt;/th&gt;&lt;th&gt;Year&lt;/th&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;Joe&lt;/td&gt;&lt;td&gt;3rd&lt;/td&gt;&lt;td&gt;August&lt;/td&gt;&lt;td&gt;1970&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;Sally&lt;/td&gt;&lt;td&gt;17th&lt;/td&gt;&lt;td&gt;August&lt;/td&gt;&lt;td&gt;1973&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
&#8216;;</p>
<p>// To send HTML mail, the Content-type header must be set<br />
$headers  = &#8216;MIME-Version: 1.0&#8242; . &#8220;\r\n&#8221;;<br />
$headers .= &#8216;Content-type: text/html; charset=iso-8859-1&#8242; . &#8220;\r\n&#8221;;</p>
<p>// Additional headers<br />
$headers .= &#8216;To: Mary &lt;mary@example.com&gt;, Kelly &lt;kelly@example.com&gt;&#8217; . &#8220;\r\n&#8221;;<br />
$headers .= &#8216;From: Birthday Reminder &lt;birthday@example.com&gt;&#8217; . &#8220;\r\n&#8221;;<br />
$headers .= &#8216;Cc: &nbsp;<a href="mailto:birthdayarchive@example.com'" title="mailto:birthdayarchive@example.com'">birthdayarchive at example.com\&#8217;</a> . &#8220;\r\n&#8221;;<br />
$headers .= &#8216;Bcc: &nbsp;<a href="mailto:birthdaycheck@example.com'" title="mailto:birthdaycheck@example.com'">birthdaycheck at example.com\&#8217;</a> . &#8220;\r\n&#8221;;</p>
<p>// Mail it<br />
mail($to, $subject, $message, $headers);<br />
?&gt;</p></blockquote>
<blockquote></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://senthoor.info/blogs/2007/10/16/send-mail-through-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
