dave seah: better living through new media Filter Navigation Temporary Redirect Page Personal Articles Productivity Articles Compact Calendar The Printable CEO Series The Printable CEO Series Back to Home Page Admin:Login

WordPress Email Form Hack

POSTED 09/21/2004 UNDER Gweeping

UPDATE: You can download a much more useful plugin at from Ryan Duff's site: wp-contactform. There's also a version with more validation of the email address (through DNS, no less) called PXSMail, which I haven't tried.

My own contact page now uses wp-contactform...I hope my email contact woes go away now :-) For historical purposes, I'm leaving the old information up.

UPDATE: Use Ryan Duff's WP-ContactForm Plugin instead.

I decided not to put my contact address directly online, but my original instructions kinda sucked. So I modified the php email script at StarGeek to work for my contact page.

To make the basic form look like the rest of this site, I copied index.php as email.php and replaced everything in the content div with the contents of this text file

Instructions

Just replace with your email address, and this might work for you too. Use email.php for your email links, and this should work. The original script makes some assumptions about how sendmail is setup on your server, so you'll need to dig into it. I'm not a PHP or linux expert, so your mileage may vary.

The CSS class might not work for IE users though unless you are applying text-align:center in a containing DIV outside of this block, or so I'm told.

Other Notes

I also was reading about a built-in email validation function at ScriptyGoddess, so I put that in too.

Thank you for printing this article! Please note that all material on this website is copyrighted by either David Seah or individual comment contributors. To request permission for republication and distribution, please contact David Seah (http://davidseah.com/contact).