<?xml version="1.0" encoding="UTF-8" standalone="yes"?><oembed><version><![CDATA[1.0]]></version><provider_name><![CDATA[David Hendler&#039;s Writing]]></provider_name><provider_url><![CDATA[https://freetaco.wordpress.com]]></provider_url><author_name><![CDATA[David Hendler]]></author_name><author_url><![CDATA[https://freetaco.wordpress.com/author/davidhendler/]]></author_url><title><![CDATA[mailing with php]]></title><type><![CDATA[link]]></type><html><![CDATA[<p>We hate it when things are more difficult than they should be. (And who is to gauge how difficult it should be? <i>We</i> should!)</p>
<p>That&#39;s how it was in our latest struggle through the Great App that will Solve all Problems (GASP). One of the last things we chose to implement in the GASP is a mailto function that will mail an internal user when an external user does something. Sounds easy, yes? And in fact, it is. But it took us a while to get there. Because we learn everything the hard way.</p>
<p>So to keep anyone else from going through the crap we went through: make sure the server you are working on will send out mail before you go nuts trying to make it work. That might seem obvious to others. But remember: we learn things the hard way. Having an external, private server can help immensely on this. Before you fuss about scripts that don&#39;t work, test them on a server you know is good.</p>
<p>So what did we use, what did we learn? Mailing something in php is a snap. Just use the <a href="http://us2.php.net/manual/en/function.mail.php">mail() function</a>. Do not listen to all the other crap out there about needing x number of files to get shit done. Use the friggin mail() function. It goes <b><i>mail($to, $subject, $message)</i></b>.</p>
<p>That said, the <a href="http://forums.surreal-atmosphere.com/index.php?s=2ad1f94ad69fb1905a0a91e969cef5f3&amp;showtopic=9&amp;pid=24&amp;st=0&amp;#entry24">Surreal-Atmosphere tutorial</a> was very helpful. So thank you for taking apart a small script and kicking it around until it made sense.</p>
<p>Many people apparantly found the <a href="http://www.phpscriptcenter.com/emailform.php">emailform.php script</a> very useful. That may be. We did not. We also did not find <a href="http://www.dtheatre.com/scripts/formmail.php">Jack&#39;s FormMail.php</a> useful. But both of these failures were, most likely, due to the server we were developing on.</p>
<p>Lastly, if you need more features in mailing, you might want to check out <a href="http://phpmailer.sourceforge.net/">PHPMailer</a> on sourceforge. They seem like there&#39;s a lot there to work with. And they have docs, which makes our cold blackened hearts happy.&nbsp;</p>
]]></html></oembed>