[RESOLVED] Anyone have any experience configuring Mercury to send emails externally?
Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: [RESOLVED] Anyone have any experience configuring Mercury to send emails externally?

  1. #1
    Senior Member
    Join Date
    Mar 2009
    Posts
    802

    resolved [RESOLVED] Anyone have any experience configuring Mercury to send emails externally?

    Not sure if this is the correct section for this, but it didn't seem to fit elsewhere.

    So here's the deal.

    At work we recently rebuilt our internal server. It was long overdue and now it runs much better... for the most part. Apache, MySQL, PHP, etc. all run like they used to, and now we're running with the latest versions of whatever is packaged with XAMPP. The only problem is we cannot get the emails to work. I wasn't involved during the set up of the email portion before, but as time went on I slowly became the de facto "server admin" simply because I knew more than the others about configuring Apache, MySQL, PHP (I've set them up manually while others do it via XAMPP), user management, mapping drives, setting permissions, etc. So I essentially inherited the server. Also over this time period the main person who configured Mercury is no longer with the company... and never documented anything. One other person was kind of involved, but doesn't remember enough to be useful. He said he just found a video online that worked with Thunderbird and that was it.

    Him and I sat down and tried to get it configured, but have had no luck. He thinks he found the video that he used before, and we followed the steps, but no matter what we have tried emails just do not send. We have googled quite a bit and read a lot of walkthroughs and watched a lot of videos, but all the same result.

    The way it worked before is you would use the mail() function and then the recipient address would receive an email from our foo@ourcompanyname.com email account. I wish I knew what the previous settings were in Thunderbird or Mercury, but like I said, unfortunately I was not involved (otherwise I would have written this stuff down).

    Just to be clear there is no error from the mail() function of any kind. When I execute a call to mail() it returns true, so PHP itself is happy with whatever configuration there is, but since we all know just because the mail() function is happy, doesn't mean the email will actually be sent/received.

    I would have thought there would be an easy way to enter credentials for an email address including SMTP information, and Mercury just sends the email on its behalf. We have all the info for our email address plus the smtp.gmail.com SMTP info, so I would have thought this process would be simple, but I guess not.

    I've tried working with MercuryC SMTP and MercuryE SMTP (amongst others) to no avail.

    Does anyone have any experience with this, or a link to a walkthrough?

    Thanks for reading.
    Declare variables, not war.

  2. #2
    High Energy Magic Dept. NogDog's Avatar
    Join Date
    Aug 2006
    Location
    Ankh-Morpork
    Posts
    13,896
    I probably don't know enough about the subject to know if this would be a viable solution, but PHPMailer comes with its own SMTP class (all native PHP) that you might be able to leverage if all else fails?
    Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." ~ from Nation, by Terry Pratchett

    "But the main reason that any programmer learning any new language thinks the new language is SO much better than the old one is because he’s a better programmer now!" ~ http://www.oreillynet.com/ruby/blog/...ck_to_p_1.html


    eBookworm.us

  3. #3
    Senior Member
    Join Date
    Mar 2009
    Posts
    802
    Quick addendum:

    I am able to send email from our server via Thunderbird through our foo@ourcompanyname.com email account. I just need to tell PHP/Mercury that when the mail() function is executed, to tell Mercury to send the email via that account.

    Quote Originally Posted by NogDog View Post
    I probably don't know enough about the subject to know if this would be a viable solution, but PHPMailer comes with its own SMTP class (all native PHP) that you might be able to leverage if all else fails?
    We'll be exploring all options if we cannot get this to work.
    Declare variables, not war.

  4. #4
    Senior Member
    Join Date
    Oct 2005
    Location
    Chicago, IL
    Posts
    428
    I apologize if this incorrect but wouldn't you just need to change your PHP.ini?

    Code:
    [mail function]
    SMTP=your_mercury_ip (ie:smtp ip)
    smtp_port=25
    sendmail_from = me@example.com
    Bob Lob Law

  5. #5
    Senior Member
    Join Date
    Mar 2009
    Posts
    802
    Quote Originally Posted by jeepin81 View Post
    I apologize if this incorrect but wouldn't you just need to change your PHP.ini?

    Code:
    [mail function]
    SMTP=your_mercury_ip (ie:smtp ip)
    smtp_port=25
    sendmail_from = me@example.com
    I've been pulled off it for now since I have some deadlines I have to meet, so I haven't had a chance to test this, but during my troubleshooting I did change the values of those items (I've since commented them out).

    This is what I currently have, which is pretty similar to what you suggested (though note the comment above the SMTP port):

    Code:
    [mail function]
    ; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
    ;SMTP = 192.168.1.150
    ;smtp_port = 25
    
    ; For Win32 only.
    ; http://php.net/sendmail-from
    ;sendmail_from = postmaster@localhost
    I guess I should change the 192.168.1.150 to 127.0.0.1 or localhost?
    Declare variables, not war.

  6. #6
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    7,694
    Quote Originally Posted by Bonesnap View Post
    I guess I should change the 192.168.1.150 to 127.0.0.1 or localhost?
    Is there a server of the correct type answering the correct port at one of those addresses?

    Not sure if you can do this from CLI in Windows, but in 'Nix it'd be something like (for SMTP):

    Code:
    telnet localhost 25
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    220 freebsd-devel.ombe.com ESMTP Sendmail 8.14.5/8.14.4; Thu, 13 Feb 2014 11:12:21 -0600 (CST)
    Which tells me, at the very least, that the Sendmail SMTP server is indeed listening on "localhost", port 25.

    If you have Win7+, I think you can also do this from the CLI (I seem to be able to from Win7).
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  7. #7
    Pna lbh ernq guvf¿
    Join Date
    Jul 2004
    Location
    Kansas City area
    Posts
    19,405
    Quote Originally Posted by Bonesnap View Post
    Code:
    [mail function]
    ; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
    ;SMTP = 192.168.1.150
    ;smtp_port = 25
    
    ; For Win32 only.
    ; http://php.net/sendmail-from
    ;sendmail_from = postmaster@localhost
    Er... is that exactly what you have? Because if you'll note the semicolons out front, that is equivalent to having:
    Code:
    [mail function]

  8. #8
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    7,694
    Quote Originally Posted by bradgrafelman View Post
    Er... is that exactly what you have? Because if you'll note the semicolons out front, that is equivalent to having:
    Code:
    [mail function]
    I don't think so ...

    Quote Originally Posted by Bonesnap View Post
    (I've since commented them out).
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  9. #9
    Pna lbh ernq guvf¿
    Join Date
    Jul 2004
    Location
    Kansas City area
    Posts
    19,405
    Ah, missed that part. Disregard.

  10. #10
    Senior Member
    Join Date
    Mar 2009
    Posts
    802
    Quote Originally Posted by dalecosp View Post
    Is there a server of the correct type answering the correct port at one of those addresses?

    Not sure if you can do this from CLI in Windows, but in 'Nix it'd be something like (for SMTP):

    Code:
    telnet localhost 25
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    220 freebsd-devel.ombe.com ESMTP Sendmail 8.14.5/8.14.4; Thu, 13 Feb 2014 11:12:21 -0600 (CST)
    Which tells me, at the very least, that the Sendmail SMTP server is indeed listening on "localhost", port 25.

    If you have Win7+, I think you can also do this from the CLI (I seem to be able to from Win7).
    Define correct type. Everything is on localhost, but I decided to try the 192.168.x address because I was getting desperate. I don't think practically it would make any difference, but who knows.

    And we are running Windows 7 Ultimate but the telnet command is not recognized. Is there any other way I can check on Windows if that's running correctly (like check a specific service or something)?

    Quote Originally Posted by bradgrafelman View Post
    Er... is that exactly what you have? Because if you'll note the semicolons out front, that is equivalent to having:
    Code:
    [mail function]
    Heh yeah I had them uncommented when I was testing it out, but since then I have them commented out. According to the php.ini file they're supposed to be *shrug*. Regardless of what I have done with those properties I have not had any difference in behaviour.

    Also, does anyone know what (if any) difference there is between Mercury and Sendmail? I've seen both come up when I've been googling, but don't know enough to differentiate them or if they're the same thing but people interchange terminology. Sometimes it seems it's part of Mercury but I haven't read anything that says that explicitly.
    Declare variables, not war.

  11. #11
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    7,694
    Dang. Lost a *huge* post here. To summarize:

    SMTP = Simple Mail Transport Protocol. Port 25/465(secure). Common MTA (Mail Transport Agent) servers include Sendmail, Postfix, Exim, Exchange, and a host of others.

    POP3 = Post Office Protocol v3. Port 110/995(secure). Common POP servers include Qpopper, Dovecot, Courier, Cyrus, Exchange, and many more.

    IMAP = Internet Message Access Protocol. Port 143/993(secure). Many POP servers also do IMAP.

    Client programs are, technically, called MUA's (Mail User-Agents). Common MUA's include tons of web apps (Gmail, anyone?), Outlook, Windows Mail, Eudora, LotusNotes, mutt, elm, pine, /bin/mail ... :P Well, at any rate, there's about a thousand ways to read email.

    The chief difference between IMAP and POP is that in IMAP messages remain on the server by default. An IMAP client must always have access to the network in order to operate, whereas a POP3 system can connect, download the messages, and disconnect.

    As near as I can tell, Mercury is David Harris' SMTP implementation, designed to work closely with his MUA Pegasus. I don't know how much of his work might be based on Sendmail. Both Mercury and Sendmail would speak (E)SMTP, but they are not the same software.

    HTH,
    Last edited by dalecosp; 02-13-2014 at 03:55 PM.
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  12. #12
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    7,694
    Incidentally, if you'd like to PM me the FQDN of your mail server, I could see if it's available from the central USA.
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  13. #13
    Senior Member
    Join Date
    Mar 2009
    Posts
    802
    Sorry for bumping this topic but this issue has come up again and I have now been allocated some time today to get the mail server working once again.

    I have been fiddling around with it and I am a little further along than I was back in February when I first tackled this. I am now able to send mail successfully through Mercury via our company GMail account using the relay client (MercuryC), so that is all set up and good. The issue I am having is the mail() function in PHP is not communicating with Mercury for some reason, so no emails are being sent from our scripts (the function always returns true but we all know that means nothing). I can't seem to find any clear instructions on exactly what to change in the php.ini file. Most articles I have read seem to write this:

    Code:
    [mail function]
    ; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
    SMTP = localhost
    smtp_port = 25
    
    ; For Win32 only.
    ; http://php.net/sendmail-from
    sendmail_from = postmaster@localhost
    But I have also tried other variations with no change in behaviour, including replacing "localhost" with "smtp.gmail.com" and replacing "25" with "587" (port 465 causes Mercury to have connection issues with Google. *shrug*). In any case, regardless of what I seem to put in for these values nothing is being "picked up" by Mercury. I am watching the core processes and the MercuryC windows in Mercury and don't see any activity when I execute the mail() function. So I guess my question is does anyone know what values I should be putting in the php.ini file, and should I be commenting the lines or not? The wording that's there is really annoying because I'm not completely sure what it means. I am of course referring to:

    Code:
    ;XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
    Any help or insight would be greatly appreciated. Thanks guys!
    Declare variables, not war.

  14. #14
    Pna lbh ernq guvf¿
    Join Date
    Jul 2004
    Location
    Kansas City area
    Posts
    19,405
    How did you verify Mercury was able to send e-mail via GMail? What client were you using to send those test e-mails?

    Seems like you just need to mimic that client's settings in PHP, perhaps?

    EDIT: Also, is Mercury's logging functionality enabled? Have you tried combing through those logs to see if there is any indication that your PHP-based e-mails are at least reaching Mercury but perhaps some other error is occurring?
    Last edited by bradgrafelman; 05-27-2014 at 10:12 AM.

  15. #15
    Senior Member
    Join Date
    Mar 2009
    Posts
    802
    Quote Originally Posted by bradgrafelman View Post
    How did you verify Mercury was able to send e-mail via GMail? What client were you using to send those test e-mails?
    In Mercury itself I went to File > Send mail message and then put in an address, subject, etc. and sent it. Saw Mercury do its thing, and then received it in the inbox of the target email. I also checked the sent box of our GMail account and it was there.

    Quote Originally Posted by bradgrafelman View Post
    Seems like you just need to mimic that client's settings in PHP, perhaps?
    You would think so, and I have tried that but to no avail. Mercury just doesn't seem to acknowledge the mail() function.

    Quick addendum: I am able to send emails via Mercury and the end-to-end module (MercuryE) as well, but those are not sent through our GMail account.

    EDIT:
    Quote Originally Posted by bradgrafelman View Post
    Also, is Mercury's logging functionality enabled? Have you tried combing through those logs to see if there is any indication that your PHP-based e-mails are at least reaching Mercury but perhaps some other error is occurring?
    The logs were not turned on, but I enabled them and ran some test runs and they don't update at all, so there's nothing in there relating to PHP. The logs only update if I send an email within Mercury itself. I tried this with both MercuryC and MercuryE, and with the SMTP values commented and uncommented in the php.ini file. The result was the same across the board.
    Last edited by Bonesnap; 05-27-2014 at 10:50 AM.
    Declare variables, not war.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •