p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional Ajax 2nd Edition ISBN: 978-0-470-10949-6 (http://p2p.wrox.com/forumdisplay.php?f=310)
-   -   AjaxMail doesn't work ?! (http://p2p.wrox.com/showthread.php?t=64377)

fly December 6th, 2007 09:22 AM

AjaxMail doesn't work ?!
I've set up the AjaxMail example from the book. Downloaded the files and uploaded to the server, set up the database, the url is something like: www.myexampledomain.com/AjaxMail
I made only changes in the config.inc file - appropriate server, database and account data.
The page shows only default folders and actions, but the list of the mails for the Inbox missing. Just "Loading...". Nothing works.

Does anybody know what I have to change in other files, or something else, to test this example?

Thanx in advance.

The environment is:
Apache/2.0.52 (Red Hat)
php 4.3.9
mysql 4.1.20

nzakas December 9th, 2007 02:26 PM

It's a little bit difficult to debug your code without some more specific information. Can you check the database table to see if there's any data there? Have you typed in your email address and mail server information correctly?

Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)

fly December 10th, 2007 02:54 AM

I know for shore, that the config file was filled with correct data, and the database was made from downloaded sql files correctly.

I done some debugging.
To start the mail client, I needed to escape the check mail line
in AjaxMail.inc (line 68,$this->checkMail();), and because I found the JSON.php file wrong (the class Services_JSON is missing), I replaced it with file downloaded from the http://pear.php.net/pepr/pepr-proposal-show.php?id=198.
Send mail option started to work but after sending the mail it stopped. I found some errors in the AjaxMail.js.

Line 104: this.info = vInfo.parseJSON();
replaced with: this.info = JSON.parse(vInfo);

Line 117: this.message = vMessage.parseJSON();
replaced with: this.message = JSON.parse(vMessage);

Line 625: var oResponse = sData.parseJSON();
replace with: var oResponse = JSON.parse(sData);

After replacing the JSON.php file and correcting those lines, the mail client sent the mail and didn't stop after it.

Still, the check mail action fails on $this->checkMail() line and stops the mail client totally. Somewhere in the pop3.class.php is the problem, but I didn't investigate it.

To see how the original files downloaded from Wrox works, follow the link:

Also, I downloaded the AjaxMail from http://sourceforge.net/projects/ajaxmail/ , it's fails to work too. I found errors in this version too.

English is not my native language. I hope that this lines clearly represents the problem.

nzakas December 10th, 2007 01:51 PM

I'm wondering if perhaps you downloaded the code from the first edition instead of the second? It seems like the code issues you're mentioning were for older versions of the AjaxMail components, both client and server. If you're sure you've downloaded the code from the second edition, it may be that older components were included by mistake.

I'll take a look later and try to figure it out.

Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)

fly December 10th, 2007 02:10 PM

The downloaded code is from the second edition. I checked out again.
I hope, you will catch some time to set up the AjaxMail and test it.
It would be nice to see completely functional.

pthesis March 18th, 2009 09:18 PM

Still a problem

I've been working on that sample application and am encountering the same problem. The page loads and gets stucks with "Loading..." displayed.

There are no entries in the database.

Were you able to find a solution to the problem?

skydiver March 28th, 2009 02:36 PM

I also have set this up, downloaded code from two places
missing files...

jminatel March 30th, 2009 11:48 AM

skydiver and the author were able to work out what the problem was (a wrong json.js version) over in this other thread:


and the updated code will be available on wrox.com tomorrow.

skydiver March 30th, 2009 11:54 AM

No the problem was NOT solved yet
Thanks for posting this without even asking if the problem was solved. I think you should setup an AjaxMail and show this off to the world!!! I think everything you publish in a book should also have some samples on the web!

I will NOT purchase another book by these people!

jminatel March 30th, 2009 12:01 PM

Shouting and rudeness are not necessary. Nicholas has been very patient in trying to sort out this problem and I apologize that I misinterpretted his replacement code as having fixed your problem.

All times are GMT -4. The time now is 09:31 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.