13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

686 Chapter 29 Building a <strong>Web</strong>-Based Email Service<br />

Extending the Project<br />

There are many extensions or improvements you could make to this project.You can<br />

look to the mail reader you normally use for inspiration, but some useful additions are<br />

the following:<br />

n<br />

n<br />

n<br />

n<br />

n<br />

Add the ability for users to register with this site. (You could reuse some of the<br />

code from Chapter 27,“Building User Authentication <strong>and</strong> Personalization,” for this<br />

purpose.)<br />

Add the ability for users to have many addresses. Many users have more than one<br />

email address—perhaps a personal address <strong>and</strong> a work address. By moving their<br />

stored email address from the users table to the accounts table, you could allow<br />

them to use many addresses.You would need to change a limited amount of other<br />

code, too.The send mail form would need a drop-down box to select which<br />

address to use.<br />

Add the ability to send, receive, <strong>and</strong> view mail with attachments. If users are to be<br />

able to send attachments, you will need to build in file upload capabilities as discussed<br />

in Chapter 19,“Interacting with the File System <strong>and</strong> the Server.” Sending<br />

mail with attachments is covered in Chapter 30,“Building a Mailing List<br />

Manager.”<br />

Add address book capabilities.<br />

Add network newsreading capabilities. Reading from an NNTP server using the<br />

IMAP functions is almost identical to reading from a mailbox.You just need to<br />

specify a different port number <strong>and</strong> protocol in the imap_open() call. Instead of<br />

naming a mailbox such as INBOX, you name a newsgroup to read from instead.<br />

You could combine this with the thread-building capabilities from the project in<br />

Chapter 31,“Building <strong>Web</strong> Forums,” to build a threaded web-based newsreader.<br />

Next<br />

In the next chapter, you build another email-related project. In this one, you build an<br />

application to support sending newsletters on multiple topics to people who subscribe<br />

through your site.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!