![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| Back Office Guy- ![]() | Php mail() Function Simple to use function that can provide numerous benifits. In most circumstances running the mail() command directly will send the mail no need to configure any setting or have your own mailserver. For shared hosting chances are php is already set up configured to your email server if this is not the case chances are your host is pretty poor. Basic Syntax PHP Code: For a simple stright forward email the below will do the job. PHP Code: PHP Code: !Notice the inclusion of the $headers, not included in the first usage i will go into this more later on Okay by know alot should be self evident about the usage, so i will just run through a few tips and tricks to give you some ideas for usage. Set within a function: Reuse the mail function within your own function PHP Code: PHP Code: Going bit more advanced some times you are going to want to inform that the mail send or did not send, in terms of a contact form PHP Code: PHP Code: Okay the $headers Using the above basic commands give a very generic email information. Some times you want to add or beautify the email to give it a more pro-look, using headers will do this and more Tips: Multiple headers should be separated with a CRLF (\r\n). email headers are plentyfull but their is just a few that you will probaly set, though for spam reasons it may be best to provide a full set of headers; PHP Code: But i want to send HTML emails how?? Easy more headers PHP Code: Well to send attachments involves some more headers and goes beyond the basic usage of this tutorial for the moment. Also i would reckon mend if wanting to send attachments, mass emails or just generally complex emails i would push people to view some of the ready made classes for php to assist you. PEAR::Mail | ||
| | |
| Advertisements |
| | #2 | ||
| MK PitStop Member | I personally use the free open source phpmailer function. It's by far the most superior piece of mailing code I've seen yet that uses the PHP mail function. http://phpmailer.sourceforge.net/
__________________ web development Free diggs for your stories bags of fashion - the latest in fashionable handbags | ||
| | |
| | #4 | ||
| MK PitStop Member | You're welcome. It's a fantastic piece of coding. Very neat and does practically everything you'd want from a mailer function. It's completely object oriented so any modifications needing made could be done with an extends class.
__________________ web development Free diggs for your stories bags of fashion - the latest in fashionable handbags | ||
| | |
| Featured Websites | ||||
|
![]() |
| Tags: basic, function, mail, php, usage |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| Featured Websites | ||||
|