Pegasus Mail & Mercury

Welcome to the Community for Pegasus Mail and
The Mercury Mail Transport System, the Internet's longest-serving PC e-mail system!
Welcome to Pegasus Mail & Mercury Sign in | Join | Help
in
Home Blogs Forums Downloads Pegasus Mail Overview Mercury Overview Wiki

Total Newbie Question -- How do you read mail sent to admin@localhost.com ?

Last post 04-20-2009, 7:21 by dilberts_left_nut. 5 replies.
Sort Posts: Previous Next
  •  04-18-2009, 23:12

    Total Newbie Question -- How do you read mail sent to admin@localhost.com ?

    I did an XAMPP install on Windows XP about 3 days ago in order to learn PHP. This installs Mercury/32. I'm trying to test a form by sending data from admin@localhost.com to admin@localhost.com. But I can't seem to figure out how to actually access and read the mail. (I know -- really dumb question...). Tried sending to my regular email address and got a "SMTP server response: 553 We do not relay non-local mail, sorry" message (discussed in another post.) After I changed the addressee to admin@localhost.com I got no further error messages. However, I can't seem to find out how to read mail in Mercury... Any help ?
    Filed under:
  •  04-19-2009, 1:24

    Re: Total Newbie Question -- How do you read mail sent to admin@localhost.com ?

    You use your mail client Big Smile

    Set up a new POP3 account with the address of your Mercury server and the username (admin in this case) and password that you setup in Mercury.

  •  04-20-2009, 2:19

    Re: Total Newbie Question -- In Pegasus and a little further along...

    Thanks much. I downloaded and installed Thunderbird (without much success) and then downloaded and installed Pegasus with a bit more progress. (Thunderbird would not accept "localhost" as a valid host.) I was able to send an email through Pegasus to the same account but when I attempted to submit form data through a PHP script to either a localhost account no mail showed up in the folders. Got the same result when I tried to send to an external account (aol, gmail, etc.) Mercury is running apparently successfully on port 25. What I need are some more testing ideas so that I can somehow isolate this problem.

     Any ideas ?

     Thanx!

  •  04-20-2009, 3:44

    Re: Total Newbie Question -- In Pegasus and a little further along...

    You need to check the MercuryS (SMTP server module) logfile to see if it was accepted, and if so the system.log file to see what the Core module did with it.

    Do you have the Mercury console windows showing so you can see in real time what is going on?

  •  04-20-2009, 7:10

    Re: Total Newbie Question -- FORM to PHP SCRIPT to MERCURY to Mail Client -- now working. Workaround for Windows bug.

    Thanks much, dln. Very educational following up on your suggestions. I'll learn this stuff yet. However, the problem seems to be a Windows bug. According to a nice tip from "Some Guy" at http://us3.php.net/mail, Windows has a bug in php/mail, which required me to insert line 12 in the code below. After this "ini_set('sendmail_from', 'myself01@locahost');" line was inserted, everything seems to be working correctly. My client is receiving something very close to properly formatted mail.

    For anyone else dealing with this, here is my corrected PHP code:

     ...

    1. <?php
    2. echo "<p>Thank you, <b>".$_POST["name"]."</b>, for your message!</p>";
    3. echo "<p>Your e-mail address is: <b>".$_POST["email"]."</b>.</p>";
    4. echo $_POST["message"]."</p>";
    5. $msg = "Name:     ".$_POST["name"]."\r\n";
    6. $msg .= "E-Mail:   ".$_POST["email"]."\r\n";  // NOTE: Change the "\r\n" to "\n" in a Linux machine.
    7. $msg .= "Message:   ".$_POST["message"]."\r\n"; 
    8. $recipient = "myself02@localhost";  // This is the receiving email address for the website.
    9. $subject = "Form Submission Results";
    10. $mailheaders = "From: My Web Site <myself01@localhost> \n";
    11. $mailheaders .= "Reply-To: ".$_POST["email"];
    12. ini_set('sendmail_from', 'myself01@locahost');
    13. mail($recipient, $subject, $msg, $mailheaders);
    14. ?>

    ...

  •  04-20-2009, 7:21

    Re: Total Newbie Question -- FORM to PHP SCRIPT to MERCURY to Mail Client -- now working. Workaround for Windows bug.

    Glad you got it working (or at least on the way Smile).

    For future debugging, and for anyone else finding this thread, turning on SESSION LOGGING in MercuryS will give a COMPLETE TRANSCRIPT of the SMTP session between the client (your PHP script) and the server (MercS). This can be very useful in pinning down any errors, and where they are occuring.

View as RSS news feed in XML

Contact | Advertise | Host provider: PraktIT | Terms of Use | Privacy Statement
Copyright © 2007-2010 David Harris / Peter Strömblad. | Pegasus Mail Home Page