Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

PHP

Utf email send function

1
2
3
4
5
function mail_utf8($to, $subject = '(No subject)', $message = '', $header = '') {
  $header_ = 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/plain; charset=UTF-8' . "\r\n";
  mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $header_ . $header);
}
 
https://snipt.net/embed/0f4f28352ddb605fb632dc0a50719b3c/
https://snipt.net/raw/0f4f28352ddb605fb632dc0a50719b3c/
0f4f28352ddb605fb632dc0a50719b3c
php
PHP
5
2016-12-05T09:13:56
True
False
False
/api/public/snipt/38190/
utf-email-send-function
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="x">function mail_utf8($to, $subject = &#39;(No subject)&#39;, $message = &#39;&#39;, $header = &#39;&#39;) {</span> </span><span id="L-2"><a name="L-2"></a><span class="x"> $header_ = &#39;MIME-Version: 1.0&#39; . &quot;\r\n&quot; . &#39;Content-type: text/plain; charset=UTF-8&#39; . &quot;\r\n&quot;;</span> </span><span id="L-3"><a name="L-3"></a><span class="x"> mail($to, &#39;=?UTF-8?B?&#39;.base64_encode($subject).&#39;?=&#39;, $message, $header_ . $header);</span> </span><span id="L-4"><a name="L-4"></a><span class="x">}</span> </span><span id="L-5"><a name="L-5"></a><span class="x"> </span> </span></pre></div> </td></tr></table>
email, send, unicode, utf8

PHP

simple php send mail script

1
2
3
<?
mail("[email protected]", "This is a test subject", "Blah Blah Blah this is the body");
?> 
https://snipt.net/embed/4ecfcdce7abfe32e9ffb7aef852c0e87/
https://snipt.net/raw/4ecfcdce7abfe32e9ffb7aef852c0e87/
4ecfcdce7abfe32e9ffb7aef852c0e87
php
PHP
3
2016-12-05T00:46:24
True
False
False
/api/public/snipt/7728/
php-send-mail-script-1
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?</span> </span><span id="L-2"><a name="L-2"></a><span class="nb">mail</span><span class="p">(</span><span class="s2">&quot;[email protected]&quot;</span><span class="p">,</span> <span class="s2">&quot;This is a test subject&quot;</span><span class="p">,</span> <span class="s2">&quot;Blah Blah Blah this is the body&quot;</span><span class="p">);</span> </span><span id="L-3"><a name="L-3"></a><span class="cp">?&gt;</span><span class="x"> </span> </span></pre></div> </td></tr></table>
mail, php, send, test
Copyrighted, illegal, or inappropriate content? Email [email protected].