<?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>Beaver6813.com &#187; email</title>
	<atom:link href="http://beaver6813.com/tag/email/feed/" rel="self" type="application/rss+xml" />
	<link>http://beaver6813.com</link>
	<description>Web Developer Extraordinaire!</description>
	<lastBuildDate>Thu, 05 Jan 2012 20:33:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-alpha-19672</generator>
		<item>
		<title>Email to SMS / Email to Mobile, Free Database</title>
		<link>http://beaver6813.com/2009/11/email-to-sms-email-to-mobile-free-database/</link>
		<comments>http://beaver6813.com/2009/11/email-to-sms-email-to-mobile-free-database/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 00:37:03 +0000</pubDate>
		<dc:creator>Beaver6813</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[carriers]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[email to sms]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[sms]]></category>

		<guid isPermaLink="false">http://beaver6813.com/?p=111</guid>
		<description><![CDATA[Heres another one of my general snippets in part of coding a new project. This database has been created solely using data from Wikipedia. I&#8217;ve edited the list, removed those which are either commercial, don&#8217;t provide actual email addresses or &#8230; <a href="http://beaver6813.com/2009/11/email-to-sms-email-to-mobile-free-database/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://beaver6813.com/2009/11/multipart-e-mail-code-for-php-text-and-html/' rel='bookmark' title='MultiPart E-Mail Code for PHP (Text and HTML)'>MultiPart E-Mail Code for PHP (Text and HTML)</a></li>
<li><a href='http://beaver6813.com/2011/01/regular-expression-for-passwords/' rel='bookmark' title='Regular Expression for Passwords'>Regular Expression for Passwords</a></li>
<li><a href='http://beaver6813.com/2010/03/city-coupons/' rel='bookmark' title='City Coupons'>City Coupons</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Heres another one of my general snippets in part of coding a new project. This database has been created solely using data from <a href="http://en.wikipedia.org/wiki/List_of_carriers_providing_SMS_transit">Wikipedia</a>. I&#8217;ve edited the list, removed those which are either commercial, don&#8217;t provide actual email addresses or those that I can visibly see don&#8217;t work. The list on Wikipedia may be slightly out of date so let me know if any carriers have changed/updated their system.</p>
<p>The database is in CSV format. <em>To download</em>, &#8220;right click -&gt; save link as&#8230; &#8221; as the link below and remove the &#8220;_.txt&#8221;. You can then import into MySQL or whatever.</p>
<p style="text-align: center;"><strong><a href="http://beaver6813.com/wp-content/uploads/2009/11/carriersemailtosms.csv_.txt">Email to SMS Database</a></strong></p>
<p style="text-align: left;">

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p111code2'); return false;">View Code</a> CSV</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1112"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
</pre></td><td class="code" id="p111code2"><pre class="csv" style="font-family:monospace;">Carrier,Region,Email,Message Format
Aircel,&quot;[18 circles], India&quot;,number@aircel.co.in,text
Airtel,&quot;Andhra Pradesh, India&quot;,number@airtelap.com,text
Airtel,&quot;Karnataka, India&quot;,number@airtelkkk.com,text
Alaska Communications Systems,USA,number@msg.acsalaska.net,text
Alltel Wireless (presently merging with Verizon Wireless),USA,number@message.Alltel.com,text
Alltel Wireless Alternative,USA,number@text.wireless.alltel.com,text
AT&amp;T Wireless,USA,number@txt.att.net,emailaddress text
Older AT&amp;T Wireless,USA,number@mmode.com,emailaddress text
AT&amp;T Mobility (formerly Cingular),USA,number@txt.att.net ,text
Cingular (Now AT&amp;T),USA,number@cingularme.com,text
AT&amp;T Enterprise Paging,USA,number@page.att.net,text
Bell Mobility &amp; Solo Mobile,Canada,number@txt.bell.ca,text
Bell Mobility Alternative,Canada,number@txt.bellmobility.ca,text
Boost Mobile,USA,number@boostmobile.com,text
Bouygues Télécom,France,number@mms.bouyguestelecom.fr,text
Loop (BPL Mobile),&quot;Mumbai, India&quot;,number@bplmobile.com,text
Cellular One (Dobson),USA,number@mobile.celloneusa.com,text
Cingular (Postpaid),USA,number@cingular.com,text
Centennial Wireless,&quot;USA, Puerto Rico, and the U.S. Virgin Islands&quot;,number@cwemail.com,text
Cincinnati Bell,USA,number@gocbw.com,text
Cingular (GoPhone prepaid),USA,number@cingulartext.com,text
Claro (Brasil),Brasil,number@clarotorpedo.com.br,text
Claro (Nicaragua),Nicaragua,number@ideasclaro-ca.com,text
Comcel,Colombia,number@comcel.com.co,text
Cricket,,number@sms.mycricket.com,text
CTI Móvil (Now Claro),Argentina,number@sms.ctimovil.com.ar,text
Emtel,Mauritius,number@emtelworld.net,text
Fido,Canada,number@fido.ca,text
General Communications Inc.,Alaska,number@mobile.gci.net,text
Globalstar (satellite),,number@msg.globalstarusa.com,text
Helio,,number@myhelio.com,text
Iridium,,number@msg.iridium.com[6],text
i wireless (T-Mobile),,number.iws@iwspcs.net,text
i-wireless (Sprint PCS),,number@iwirelesshometext.com,text
Koodo Mobile,Canada,number@msg.telus.com,text
Mero Mobile,Nepal,+977number@sms.spicenepal.com,text
MetroPCS,,number@mymetropcs.com,text
Movicom,,number@movimensaje.com.ar,text
Mobitel,Sri Lanka,number@sms.mobitel.lk,text
Movistar,Colombia,number@movistar.com.co,text
MTN,South Africa,number@sms.co.za,text
MTS Mobility,Canada,number@text.mtsmobility.com,text
Nextel ,United States,number@messaging.nextel.com,text
Nextel,México,number@msgnextel.com.mx,text
Nextel,Argentina,number@nextel.net.ar,text
Orange Polska,Poland,number@orange.pl,text
Plus,Poland,+48number@text.plusgsm.pl,text
PC Telecom,Canada,number@mobiletxt.ca,text
Qwest Wireless,USA,number@qwestmp.com,text
Rogers Wireless,Canada,number@pcs.rogers.com,text
SaskTel,Canada,number@sms.sasktel.com,text
Setar Mobile,Aruba,+297number@mas.aw,text
Sprint (PCS),USA,number@messaging.sprintpcs.com,text
Sprint (Nextel),USA,number@page.nextel.com,text
Suncom,,number@tms.suncom.com,text
Sunrise Communications,Switzerland,number@gsm.sunrise.ch,text
Syringa Wireless,USA,number@rinasms.com,text
T-Mobile,USA,+1number@tmomail.net,text
T-Mobile,Austria,number@sms.t-mobile.at,text
T-Mobile,Croatia,+385number@sms.t-mobile.hr,emailaddress##subject#text
Telus Mobility,Canada,number@msg.telus.com,text
Tigo (Formerly Ola),Colombia,number@sms.tigo.com.co,text
Tracfone (prepaid),,number@mmst5.tracfone.com,text
Unicel,USA,number@utext.com,text
US Cellular,USA,number@email.uscc.net,text
Verizon,USA,number@vtext.com,text
Viaero,USA,number@viaerosms.com,text
Virgin Mobile,Canada,number@vmobile.ca,text
Virgin Mobile,USA,number@vmobl.com,text</pre></td></tr></table></div>

<p>Related posts:<ol>
<li><a href='http://beaver6813.com/2009/11/multipart-e-mail-code-for-php-text-and-html/' rel='bookmark' title='MultiPart E-Mail Code for PHP (Text and HTML)'>MultiPart E-Mail Code for PHP (Text and HTML)</a></li>
<li><a href='http://beaver6813.com/2011/01/regular-expression-for-passwords/' rel='bookmark' title='Regular Expression for Passwords'>Regular Expression for Passwords</a></li>
<li><a href='http://beaver6813.com/2010/03/city-coupons/' rel='bookmark' title='City Coupons'>City Coupons</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://beaver6813.com/2009/11/email-to-sms-email-to-mobile-free-database/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MultiPart E-Mail Code for PHP (Text and HTML)</title>
		<link>http://beaver6813.com/2009/11/multipart-e-mail-code-for-php-text-and-html/</link>
		<comments>http://beaver6813.com/2009/11/multipart-e-mail-code-for-php-text-and-html/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 15:53:26 +0000</pubDate>
		<dc:creator>Beaver6813</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[compatability]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[mime]]></category>
		<category><![CDATA[multipart]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[updated]]></category>

		<guid isPermaLink="false">http://beaver6813.com/?p=88</guid>
		<description><![CDATA[Whilst trawling through some of my ultra-old posts on various forums I&#8217;ve found this nifty little piece of code that enables you to send in both HTML and TEXT form. This is useful for clients that cant display HTML (they &#8230; <a href="http://beaver6813.com/2009/11/multipart-e-mail-code-for-php-text-and-html/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://beaver6813.com/2009/11/email-to-sms-email-to-mobile-free-database/' rel='bookmark' title='Email to SMS / Email to Mobile, Free Database'>Email to SMS / Email to Mobile, Free Database</a></li>
<li><a href='http://beaver6813.com/2010/03/godaddy-mod_rewrite-hell/' rel='bookmark' title='GoDaddy mod_rewrite Hell'>GoDaddy mod_rewrite Hell</a></li>
<li><a href='http://beaver6813.com/2010/06/php-tld-list-inc-level-2-3/' rel='bookmark' title='[PHP] TLD List, Inc. Level 2 &amp; 3'>[PHP] TLD List, Inc. Level 2 &#038; 3</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Whilst trawling through some of my ultra-old posts on various forums I&#8217;ve found this nifty little piece of code that enables you to send in both HTML and TEXT form. This is useful for clients that cant display HTML (they will display the text instead). I developed it back in 2007 so it may need updating but its a useful bit of code!<br />
<em>UPDATE: Peter Mills recently emailed me with a problem with this script and compatability with gmail, I have managed to fix this. It seems that gmails parser has gotten even more strict, there were stray line breaks where there shouldnt have been and the initial boundary declaration in the headers was not wrapped properly in double quotes! Cheers for finding this bug Peter and hopefully its all working again now!</em><br/></p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p88code4'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p884"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
</pre></td><td class="code" id="p88code4"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
Sam Cleaver aka Beaver6813 (http://www.beaver6813.com)
Mutlipart Email Script, Sends In Both Plain And HTML For Compatibility
Which Works With MIME 1.0+ Supporting Software.
Email: samcleaver.beaver[-at]gmail[-dot]com
Copyright (C) 2007  Beaver6813
Updated November 2009. Thanks to Peter Mills for his help in recognising
the recent problem the script had with GMail!
--------------------------------------------------------------
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
--------------------------------------------------------------
*/</span>
<span style="color: #666666; font-style: italic;">/*
 CHANGES:
 -- Is Now Compatible With GMail
 -- Encrypts Messages In Base64 For Easier Transportation
 -- 03/11/09 - Changed to work with changes in GMail, removed now unnecessary base64 encoding
 NOTES:
 -- From experience with different mail services i've discovered some key pointers
 when sending html or any type of email:
  * DO NOT link to external CSS stylesheets, most of the time these are either filtered out
  or do not load properly
  * As discovered in GMail it strips out any stylesheets completely, even inline ones so you're
  going to have to use the style='' tags on any div's etc you want to make look pretty
  * Bear in mind linking to any external resources will bring up a warning on the clients
  end and they can choose to or not to load external resources.
  * Keep HTML resources as simple as possible, most of the time they aren't loaded as well as
  they would in firefox and so can be really mucked up if you do some complicated magic with
  them.
 COMING SOON:
 -- Will be turned into a class making it easier to send emails :)
*/</span>
<span style="color: #666666; font-style: italic;"># Is the OS Windows or Mac or Linux
</span><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/strtoupper"><span style="color: #990000;">strtoupper</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">PHP_OS</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">'WIN'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$eol</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/strtoupper"><span style="color: #990000;">strtoupper</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">PHP_OS</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">'MAC'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$eol</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$eol</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000088;">$_emailer_subject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;My First Email Yay!&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//The subject of the email... duh</span>
<span style="color: #000088;">$_emailer_to</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;sam@beaver6813.com&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//You can make this even easier for the</span>
 <span style="color: #666666; font-style: italic;">//email client by specifying the actual name of the person as well, but for</span>
 <span style="color: #666666; font-style: italic;">//simplicities sake we'll just give the email</span>
<span style="color: #000088;">$_emailer_from</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;test@localhost&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Again, you can do to this what</span>
<span style="color: #666666; font-style: italic;">//i said above</span>
<span style="color: #000088;">$_emailer_reply_to</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;test@localhost&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$_emailer_cc</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Optional</span>
<span style="color: #000088;">$_emailer_bcc</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//Optional</span>
<span style="color: #666666; font-style: italic;">//Okay what do you want to appear if it displays the plain text version?</span>
<span style="color: #000088;">$email_html</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;h1&gt;HTML E-mail&lt;/h1&gt;
&lt;p&gt;This is an &lt;b&gt;HTML&lt;/b&gt; e-mail.&lt;/p&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//Okay what do you want to appear if it displays the HTML version?</span>
<span style="color: #000088;">$email_plain</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;HTML E-mail<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>This is the text portion of an HTML e-mail<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">/* YOU NEED CONFIGURE NOTHING MORE!!!! (Apart from the respond at the very bottom of this script!) */</span>
<span style="color: #000088;">$_emailer_subject</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_emailer_subject</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">''</span> ? <span style="color: #0000ff;">'No Subject'</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$_emailer_subject</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Must have a subject</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_emailer_cc</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #000088;">$_emailer_cc_do</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Cc: &quot;</span><span style="color: #339933;">.</span><a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_emailer_cc</span> <span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span> <span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">2</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Remove the trailing &quot;, &quot;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_emailer_bcc</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #000088;">$_emailer_bcc_do</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Bcc: &quot;</span><span style="color: #339933;">.</span><a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_emailer_bcc</span> <span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span> <span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">2</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$_emailer_reply_to</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_emailer_reply_to</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">''</span> ? <span style="color: #000088;">$_emailer_from</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$_emailer_reply_to</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mid</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/md5"><span style="color: #990000;">md5</span></a><span style="color: #009900;">&#40;</span> <a href="http://www.php.net/uniqid"><span style="color: #990000;">uniqid</span></a><span style="color: #009900;">&#40;</span> <a href="http://www.php.net/time"><span style="color: #990000;">time</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Generate a unique id for the email</span>
<span style="color: #000088;">$host</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'www'</span> <span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span> <span style="color: #339933;">,</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_HOST'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Remove the www for an &quot;email address&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//add From: header</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;From: <span style="color: #006699; font-weight: bold;">$_emailer_from</span><span style="color: #006699; font-weight: bold;">$eol</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//specify MIME version 1.0</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;Return-Path: <span style="color: #006699; font-weight: bold;">$_emailer_reply_to</span><span style="color: #006699; font-weight: bold;">$eol</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$_emailer_cc_do</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$_emailer_bcc_do</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;MIME-Version: 1.0<span style="color: #006699; font-weight: bold;">$eol</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;Message-ID: &lt;<span style="color: #006699; font-weight: bold;">$mid</span>@<span style="color: #006699; font-weight: bold;">$host</span>&gt;<span style="color: #006699; font-weight: bold;">$eol</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;X-Priority: 3<span style="color: #006699; font-weight: bold;">$eol</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;X-MSMail-Priority: Normal<span style="color: #006699; font-weight: bold;">$eol</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;X-Mailer: PHP<span style="color: #006699; font-weight: bold;">$eol</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;X-MimeOLE: Generated By Beaver6813s MultiPart Mail Script<span style="color: #006699; font-weight: bold;">$eol</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;Date: &quot;</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/gmdate"><span style="color: #990000;">gmdate</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'D, d M Y H:i:s Z'</span> <span style="color: #339933;">,</span> <a href="http://www.php.net/time"><span style="color: #990000;">time</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$eol</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//unique boundary this can be whatever you want... but try and make it imaginative :)</span>
<span style="color: #000088;">$boundary</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/uniqid"><span style="color: #990000;">uniqid</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;BEAVER6813&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//tell e-mail client this e-mail contains//alternate versions</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;Content-type: multipart/alternative; boundary=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">$boundary</span><span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//plain text version of message</span>
<span style="color: #000088;">$body</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;--<span style="color: #006699; font-weight: bold;">$boundary</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;Content-Type: text/plain; charset=<span style="color: #000099; font-weight: bold;">\&quot;</span>iso-8859-1<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;Content-transfer-encoding: 8bit&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$body</span> <span style="color: #339933;">.=</span> <a href="http://www.php.net/chunk_split"><span style="color: #990000;">chunk_split</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$email_plain</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//HTML version of message</span>
<span style="color: #000088;">$body</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;--<span style="color: #006699; font-weight: bold;">$boundary</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;Content-Type: text/html; charset=<span style="color: #000099; font-weight: bold;">\&quot;</span>iso-8859-1<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;Content-Transfer-Encoding: quoted-printable&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$body</span> <span style="color: #339933;">.=</span> <a href="http://www.php.net/chunk_split"><span style="color: #990000;">chunk_split</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$email_html</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;"># Finished
</span><span style="color: #000088;">$body</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;--<span style="color: #006699; font-weight: bold;">$boundary</span>--&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// finish with two eol's for better security.</span>
<span style="color: #666666; font-style: italic;">//send message</span>
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mail"><span style="color: #990000;">mail</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_emailer_to</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_emailer_subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span><span style="color: #339933;">,</span> <span style="color: #000088;">$headers</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;MAIL SENT SUCCESSFULLY. YOU'RE A WINNER!&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;SOME WEIRD ERROR :S. YOU LOSE&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Related posts:<ol>
<li><a href='http://beaver6813.com/2009/11/email-to-sms-email-to-mobile-free-database/' rel='bookmark' title='Email to SMS / Email to Mobile, Free Database'>Email to SMS / Email to Mobile, Free Database</a></li>
<li><a href='http://beaver6813.com/2010/03/godaddy-mod_rewrite-hell/' rel='bookmark' title='GoDaddy mod_rewrite Hell'>GoDaddy mod_rewrite Hell</a></li>
<li><a href='http://beaver6813.com/2010/06/php-tld-list-inc-level-2-3/' rel='bookmark' title='[PHP] TLD List, Inc. Level 2 &amp; 3'>[PHP] TLD List, Inc. Level 2 &#038; 3</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://beaver6813.com/2009/11/multipart-e-mail-code-for-php-text-and-html/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

