I am interested in building a standard/basic email application where people can log in check their emails, send email, save emails, create folders, etc., the basic email functions you would find in yahoo mail or gmail. I am not sure where to start. I am familiar with PHP, Mysql, Javascript.
Can an entire email application be build using php, mysql and javascript? If so, is there any documentation, books, websites, etc., that might walk me through how to build this email application?
Also I am wondering if there is any php libraries, extensions, plug-ins, etc., to jump start an email application or any shortcuts to speed up development of this type of application.
Thank you.
You can take a look at these open source project that make exactly what you want (with SMTP and IMAP support). All in PHP
You can browse its source code freely.
There are more projects like this.
I would check out the source code from one of the many PHP web email clients. Squirrelmail is a good standard:
Here is the download page:
Yes, it is possible to write such an application using PHP, MySQL and JavaScript, and no, there are (probably) no books on how to complete this specific task. Some existing applications are Roundcube Mail and Squirrel Mail.
If you are trying to write this application as an educational task, I'd encourage you to do so, otherwise I'd advise you to now reinvent the wheel, E-Mail has been around for quite some time, and therefore the webmail applications are equally numerous.
That said, most of the stuff you need is already present in most PHP5 installations:
Sure. You can do that with just those technologies. In fact you can do it with just PHP and MySQL. You would want to use PHP's mail()
function thusly:
<?php
$to = "someone@example.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "someonelse@example.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
The rest would just be database schema and figuring the correct data objects and the logic and presentation necessary.
I would begin by thinking about what data objects are necessary. I would assume the following tables would be a good start:
user
email
folder
Good luck!
References:
http://www.w3schools.com/php/php_mail.asp
EDIT: At first glance this seems like it might be helpful: http://www.phphelp.com/article/article.php?art=2