Emailing with PHP

Okay I may be jumping ahead a little here but it’s hard to tell you about something and then not use the new found knowledge with a practical example for a few more weeks until I hit the ‘meaty’ stuff. So a quick explaination of how to email with PHP and then you can tie this together with posting form variables.

The simplest function to email is the mail() function. A quick and simple method would be

<?php mail("", "Subject Line Goes Here", "Mail Text goes here", "Headers go here but simple ones are From:"); ?>

The headers are just the mailing headers and can be expanded on to state the type of text (plain or html), character set used etc. But for now we’ll stick to the simple “From:”.

So that was an easy lesson!

You may also like...