PHP simple : PHP tutorial, MySQL tutorial
PHP Tutorial - Free PHP Script

Home | Tutorials | Php vs Node.Js | Web Tools

Create your Email Server


Tutorials > Create your Email Server

When you create an auto email sender program with mail() function. You can not to test it on your machine(localhost). You have to upload and test it on your web hosting, but now you can test php mail() function on your localhost using Argosft mail server.

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.

Click here to download Mail Server Freeware


ArGoSoft Mail Server Installation.

  1. Install this program to your machine.

    ArGoSoft Mail Server

  2. Go to Tools > Options. Then select tab "Local Domains".
    1. Put "localhost" and click "Add" button.
    2. Click "OK" button.

    ArGoSoft Mail Server


  3. Go to Tools > User
    1. Click on Add New User icon.
    2. Fill your user name, name, password. User name refers to your email address ([email protected]). Then click "OK" and "Close" button.

    ArGoSoft Mail Server

  4. Set up your Email Client Software. (Microsoft Outlook, Incredimail, Mozilla Thunderbird, etc.) by create a new email account with information below;
    - Email address "[email protected]" and password as the same that created in ArGoSoft Mail Server.
    - Incomming and Outgoing mail use "localhost".
    - Other settings, you should be set as the standard settings or default by programs.


Test your email server

Create a PHP file "send_email.php" for test ArGoSoft Mail Server on your machine. This file using mail() function for send some parameters from this file to your email server.

Syntax:

mail(target_email, subject, message, email_from);

send_email.php

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?
// Target email address.
$to="[email protected]";

// Your subject.
$subject="Test Email";

// Sender. You may put the sender's email address after "from:". This example file use "[email protected]"
$mail_from="from: [email protected] n";
// Set this email to HTML email format.
$mail_from .="Content-Type: text/html; charset=utf-8 n";

// Your message.
$message="Hello, This is your test email.<br>
Your email server is working now!
";

// Send email.
$sentmail = mail($to,$subject,$message,$mail_from);

// If your email succesfully sent.
if($sentmail){
echo "Email has been sent.";
}
else {
echo "Cannot send email.";
}
?>

</body>
</html>

  • Copy this code and save as send_email.php to your root folder, open this file by browse to http://localhost/send_email.php.
  • Open your email client program to recieve email.

Advertise
Put Ebay RSS Feeds onto your website
SEO Elite Software
Domain Dashboard CPanel & Seo Manager
Work at Home Ideas and Opportunities
Introduction & Get Start
Using Form
PHP
PHP Tags
PHP Variables
PHP Control Structures
MySQL
Create Database & Table
Database Connection
Insert Record
Select Record
Update Record
Delete Record

PHPsimple.net
[email protected]