Email testing has been a headache for most developers. You need to upload your script every now and then just to check if your script is working. A tedious work especially when you got a bunch of email script to work on. It would have been very nice if you could do it locally in your pc.
XAMPP provided an email server to PHP developers that would help ease our suffering. Mercury is a pre-installed mail server in the XAMPP that only a few knows how to use. I am one of the many that don’t until recently, I needed to test a lot of email scripts and frequent uploading is oftentimes vexing.
I have found a good thread that helped me in setting up the mail server in my computer.
In this tutorial, we will be needing XAMPP bundle (I am using version 1.7.0) and Thunderbird as our email manager. I will be assuming that you have successfully installed both softwares in your computer.
Running Mercury and Apache Server
Open your XAMPP Control Panel(CP) (Start > Apache Friends >XAMPP Control Panel) and make sure that Mercury mail and Apache is running. If not simply click the ‘Start’ button beside them.
In the XAMPP CP, open the Admin area of Mercury by clicking the corresponding admin button. Warning: Do not close any of the window inside the admin area.
In the admin area, go to Configuration > Manage Local User. In here, we could set the admin password and create new user.
To add admin password, select admin then hit ‘Change’. Fill-up ‘Mail Password’ then ‘Ok’.
To add new user, click ‘Add’ then enter username and password for the user.
Remember: the username is used as the email address. Example: Username=admin, Email=admin@localhost
Here, I created useraccount ‘jane’, so her email will be ‘jane@localhost’. We use ‘localhost’ because we are running our mail server in our localhost.
Default ‘From’ Email address
To set our default email address, open file ‘XAMPP\apache\bin\php.ini’. Warning: If you are not familiar with php.ini file, it is best that you a save copy of the file before commiting any changes to it.
Search for ‘;sendmail_from’ and change this line to ‘sendmail_from = admin@localhost’ then save. We must now restart our Apache server.
After setting up our mail server, let us now configure our Thunderbird so that we could read the emails that we would be sending in our localhost.
Open up the Thunderbird browser. Go to Tools > Account Settings. In the new window, Click ‘Add Account’ then follow the steps from the images below. Create an account for admin@localhost and jane@localhost (or whichever user account you created).
Testing Email Script
In your ‘XAMPP\htdocs’ create a folder named test. Inside ‘test’ folder, create an email script similar to the one below then save it as ’emailtest.php’. Run your script in your browser. ‘http://localhost/test/emailtest.php’. The output should be ‘bool(true)’.
Open your Thunderbird browser then click ‘Get Mail’. Enter the corresponding passwords once the prompt box appear.
The output should be similar to the one below
And there you go. You can now run your email script in your local pc.
We are currently hanging out at Starbucks Trinoma. Me, meo and little bro are spending our Sunday to enjoy. Later, we will go to church after hanging out.
The whole week have been boring and frustrating and there is no other thing we need but to relax.
It is a really cool feeling to flaunt your laffy taffy at the middle of the crowd and look at their faces caught in awe. hehe I am not that mean don’t worry.
Tomorrow would be a very special day for me. Besides Chinese New Year and Annular Solar eclipse, I would start my review for ZCE. I will be self-studying because the online review is expensive.
I will enjoy this day to the fullest because tomorrow, I will be heading to a tedious path of work and studies.
^_^ Good luck to me.
Just got from php.net
The PHP development team would like to announce the immediate availability of PHP 5.2.8. This release addresses a regression introduced by 5.2.7 inregard to the magic_quotes functionality, that was broken by an incorrect fix to the filter extension. All users who have upgraded to 5.2.7 are encouraged to upgrade to this release, alternatively you can apply a work-around for the bug by changing “filter.default_flags=0” in php.ini.
Due to a security bug found in the PHP 5.2.7 release, it has been removed from distribution. The bug affects configurations where magic_quotes_gpc is enabled, because it remains off even when set to on. In the meantime, use PHP 5.2.6 until PHP 5.2.8 is later released.
Read more at php.net
If you are planning to take Zend’s PHP 5 Certification, here is a quick list of the exam’s coverage:
- Control Structures
- Language Constructs and Functions
- Variable Scope
- Enumerated Arrays
- Associative Arrays
- Array Iteration
- Multi-Dimensional Arrays
- Array Functions
Object Oriented Programming
- Static Methods & Properties
- Type Hinting
- Class Constants
- Session Security
- Cross-Site Scripting
- Cross-Site Request Forgeries
- SQL Injection
- Remote Code Injection
- Email Injection
- Filter Input
- Escape Output
XML and Web Services
- XML Basics
- XML Extension
- Webservices Basics
Strings and Patterns
Databases and SQL
- Analyzing Queries
- Prepared Statements
- GET and POST data
- HTTP Headers
Streams and Network Programming
- File System Functions
PHP is a computer language used to create dynamic web pages.
What makes it great? It’s platform independent, easy to use and best of all it’s FREE. It runs under PHP Licence.
What is PHP Licence? The PHP License is the software license under which the PHP programming language is released. The PHP License is a GPL incompatible free software license according to the Free Software Foundation and the Open Source Initiative.
The current stable version of PHP is 5.2.6. Here is the release history of PHP:
|Red||Old release; not supported|
|Yellow||Old release; still supported|
The PHP User Group of the Philippines (PHPUGPH) held a seminar about Test-Driven Development last March 15, 2008 at dotPH Domains Inc in Jollibee Plaza, Ortigas.
Here is an excerpt from our forum about the speaker.
Andre John Cruz aka cruizer is a Microsoft MVP for Visual C# and an Administrator for PHPUGPH.com. His day job is an Application Developer for Barclays Capital Singapore. He is an avid FOSS enthusiast, and also an active participant in various user communities in the Philippines, both Microsoft and non-Microsoft oriented. He is known as a proponent of the test-driven development (TDD) practice in the .NET world and has spoken a few times about the topic in recent Philippine MSDN events.
He was very humble and very open. He answers every questions laid in front of him. If there are things that he doesn’t know or has a doubt, he will tell you about it and try to suggest related sites or ideas about them.
For any inquiries, there is a free CD for the who asked the question. I am sad that I did not have the guts to asked. 😦 *sigh
It was the first seminar that I have attended after student days. Most of the attendees are IT Professionals like me. The officers are friendly and fun to be with. And they value time much. The event started exactly at 2:30 PM and the break time was followed accordingly.
The venue is great. It has a very workable and comfortable atmosphere suitable for the event. And even if you don’t have a microphone, your voice can be heard all over the room.
The discussion included:
- What is TDD and the pros / cons of using it
- How to use SimpleTest in TDD
- Examples of basic and intermediate TDD coding
- Practical Way of Writing your OOP
- Unit testing
The seminar was a success for me. I believe that Sir Andre has imparted a very important coding technique which is very practical and manageable, TDD that is. Despite his hectic schedule while in the Philippines, he manages to speak for this remarkable event.
At the end of the discussion, prizes were given to the attendees. The most adorable one is the T-shirt from sir AJ. I love that shirt. 😦
Congratulations to all who have made the event happened. To the officers of PHPUGPH, dotPH Domains where the event was held, to the people who has lended their hands and to the participants of the events.
MABUHAY PHPUGPH! 🙂
internet surfing is one of my hobbies that i am most talented with. i love exploring the net and stumbling on new web pages every now then. besides discovering sites, i love downloading and trying out softwares. and because of my profession, i oftentimes search for text editors that might be very useful to me.
one of my favorite is the PHP Designer. the first version of it that i’ve tried was PHP Designer 2007 and used it for 30 days and loved the experience of coding with it.
then until recently, from our forum at phpugph.com, i just got the news that phpdesigner 2008 was released so i head on to google.com to look for the available trial version. i got a copy from download.com, downloaded and tested it of course.
after minutes of exploration, here are the things i could say i like from this software:
1. on new file, it automatically adds the opening and closing php tags together with a file information comment
2. highlights the line of error, place a red mark on the line number and on highlight to the error line, it shows a tooltip of the error description.
3. shows a tooltip description of built-in function
4. auto-complete function
5. codefolding tree includes the classes, functions variables and contants, and the total number of occurences for each values.
6. xdebug is already built-in
7. has smarty variables ready
8. FTP connection can be set up fast and easy just go to Tools->FTP
9. profiler ready
10. the navigation toolbar was very organized according to ussability
guess there are still lots that i am going to like about PHP Designer 2008. i could say that my 14-days software trial is worth it. i’ll just continue my exploration next time. hope i’ve imparted good information to you. bye for now ^_^