| Home > Computer & I'net > Email - Basics... |
|
|
|||||||||||||||
|
|
|||||||||||||||
|
||||||||||||||||
Email - Basics | |
mail ("recipient","subject","message"); The first value is an email address. Where the information is going to be sent to. The second value is a short sentense or note. It will appear in the SUBJECT field of the email. The third value is the main body message. Values can be entered directly into the mail command. <?php mail("yourplace@somewhere.com","My email test.","Hello, how are you?"); ?> Many people prefer to use variables to pass the information into it. <?php $to = "yourplace@somewhere.com"; $subject = "My email test."; $message = "Hello, how are you?"; mail($to,$subject,$message); ?> To know if the email was successfully sent out, an IF command can be used on the mail command. The mail command produces a positive result upon success. <?php
$to = "yourplace@somewhere.com"; $subject = "My email test."; $message = "Hello, how are you?"; if ( mail($to,$subject,$message) ) { echo "The email has been sent!"; } else { echo "The email has failed!"; } ?> The further email tutorial pages will build onto this example. Change the values to your own, save it it as a php file, upload and test it on your hosted space. Viewing the page, the script will automatically go and send an email. If it works, you are ready to continue further. ----------------- Article by David Stanley. Visit his site http://www.htmlite.com. Reprinted with permission. | |
| Articles |
•Auto & Trucks•Business•Computer & I'net·General·Apache·CSS·Database·Hardware·HTML·Javascript&DHTML·Linux·MySQL·Operating System·Perl / CGIPHP·Programming·Publishing·Search Engines·Software Problems·SSI·Tips & Tricks·Utilities·Web Design•Family•Food & Drink•Gardening•Health•Other•Pets•Psychology•Spiritual•Travel•Women |
| Calculators |
|