All PHP Tutorials
Ad Management
Counter
Email System
Forum and Guestbook
File Upload
Image Manipulation
Login / Members / Password
Pagination
Encode Script
Refresh / Redirection
Miscellaneous
All MySQL Tutorials
Create, Manage Database using phpMyAdmin
Connect to Database
Insert Data
Select Data
Edit Database
Update Database
Delete Database
Order Results



Home > PHP Tutorials
Test php mail function on your localhost
Test php mail function on your localhost
When you code php mail function you can't test it on your localhost you have to upload and test it on your hosting but now you can test php mail function on your localhost using Argosft mail server. 
 
  Overview

ArGoSoft Mail Server is full SMTP/POP3/Finger/IMAP server for all Windows platforms, which will let you turn your computer into the email system. It is very compact, takes about 1-5 Mb of disk space (depending on the version), does not have any specific memory requirements, and what is the most important - it's very easy to use.

Download
- Click here to download Mail Server Freeware

Similar Software
- Kerio Mail server (PC+MAC, Free Trial)


Run ArGoSoft Mail Server

 

Run Argosoft you'll see this

Go to Tools > Options

- Go to Tools > Options
- Select tab Local Domains
- Add "localhost" to list and click ok!

Go to Tools > User

- Go to Tools > User You'll see User Setup
- Click on Add New User icon
- fill your user name, name, password user name refers to your email address (user_name@localhost) Now! we have email address "me@localhost"
 

Open You email client software i.e outlook express, incredimail, Thunderbird

In this tutorial we use outlook express
- Open outlook express go to Tools > Accounts...
- Click Add > Mail
- Insert your name, insert your email that you have created in previous step (me@localhost)or else


Config email server name, internet mail logon
- Email server name - Incomming mail and Outgoing mail type "localhost"
- Internet mail logon - Account name type your user name (me) and the same password that created using Argosoft

Ready to test
- Now you're ready to test, copy this code and save as filename.php and test open this file by open url:http://localhost/filename.php
- Open Outlook to recieve email

############### Code

<?

// ---------------- SEND MAIL FORM ----------------

// send e-mail to ...
$to="me@localhost";

// Your subject
$subject="Test";

// From
$header="from: your name <your email>";

// Your message
$message="Hello \r\n";
$message.="This is test\r\n";
$message.="Test again ";

// send email
$sentmail = mail($to,$subject,$message,$header);

// if your email succesfully sent
if($sentmail){
echo "Email Has Been Sent .";
}
else {
echo "Cannot Send Email ";
}

?>

Random
 
Simple Ad Rotation Script
This is a very easy and simple ad rotation script, you can set percentage to show the ads and you can adapt this script to rotate any thing. 
 
 
   
Hosted by Hostgator
© PHPeasystep.com 2005-2007