1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SMTP Emails Not Sending

Discussion in 'Troubleshooting and Problems' started by Jeremy P, Oct 14, 2010.

  1. Jeremy P

    Jeremy P Well-Known Member

    I am using Google Apps to power email for the domain, and to prevent being marked as spam, have configured XenForo to send mails through Google's SMTP servers. However, emails aren't being sent.

    I am certain it is configured properly, and have tested it with equivalent settings using PHPMailer on the server, which was able to send them fine. When I test is with a contact email in XenForo, no errors are given, but yet the email is not received.

    I'm not sure if this is a bug in the software, or what could be preventing them from being sent, but I would appreciate any help or information on the problem.

    Thanks.
     
  2. ENF

    ENF Well-Known Member

    Hi,

    I can confirm that Google Apps SMTP works with the current build of XenForo.

    My specific settings that work:

    SMTP: smtp.gmail.com Port: 587
    Username: myaccount@mydomain.com (matching password set correctly)
    Encryption: TLS

    The sent email appears correctly in the "sent" items on the account used to send mails and the target email address receives the email correctly.
     
  3. Blandt

    Blandt Well-Known Member

    Are you using a shared hosting ?
     
  4. Jeremy P

    Jeremy P Well-Known Member

    Still no luck. I was using SSL on port 465, and as I said I have tested the configuration with PHPMailer, which was able to send them fine. Would there be something required on the server-side that is XenForo/Zend_Mail specific to send via SMTP?
     
  5. Jeremy P

    Jeremy P Well-Known Member

    No it is a VPS, I have full root access.
     
  6. Blandt

    Blandt Well-Known Member

    ok ... do you have a mail server installed ? like postfix ?

    What distro are you running ?
     
  7. Jeremy P

    Jeremy P Well-Known Member

    Sendmail is installed, and PHP can send mail using mail() fine. Ubuntu 10.4.
     
  8. Blandt

    Blandt Well-Known Member

    Can you install postfix ? (deafult configuration is plug-n-play basically no need to mess with it)
     
  9. ENF

    ENF Well-Known Member

    The PHP mail settings should have no impact on SMTP usage.

    If I'm not mistaken, using the SMTP option (vs. default) in XenForo skips the mail configuration in PHP and strictly uses SMTP.
     
  10. Blandt

    Blandt Well-Known Member

    Yes you are absolutely right ! and that's why phpmail works and not SMTP.
    Check your IP tables man! your port is blocked (most likely)
     
  11. Jeremy P

    Jeremy P Well-Known Member

    That is what I was thinking.
    I have tried disabling the firewall entirely with no luck. When I say PHPMailer, I mean this, which is a library for sending directly via SMTP as well. Using that, the email sends fine. I am very puzzled as to why it won't work with XenForo.
     
  12. Blandt

    Blandt Well-Known Member

    Just purge sendmail and install postfix. The only option left is that sendmail is not configured properly and I am certain postfix will work out of the box (I tired it on several xenforo installations for members on here)
     
  13. ENF

    ENF Well-Known Member

    gmailsmtpconfig.jpg
    Just for posterity, I've attached my SMTP configuration screen capture from XenForo.

    The only other things I can suggest is trying the different port. Google Apps specifies that TLS be used with port 587. SSL is 465. (http://mail.google.com/support/bin/answer.py?hl=en&answer=13287)

    So, if you have not tried it, use port 587 in XenForo, using the TLS option.

    Let us know how it turns out.

    Edit: My point here, I've had problems in the past in using SSL with Google Apps. TLS has been more reliable and always works, whereas SSL just wouldn't work in some cases.
     
  14. Jeremy P

    Jeremy P Well-Known Member

    I have dropped sendmail and installed postfix, not sure it would make much of a difference here, but just in case. Still no luck.

    I appreciate the help, unfortunately neither option will work for me. The only thing I can think of is I am overlooking a very simple typo, however after checking over and over, I don't believe I am. Any other suggestions?
     

    Attached Files:

  15. Blandt

    Blandt Well-Known Member

    Does the default work ?
     
  16. Jeremy P

    Jeremy P Well-Known Member

    The default can send mail() via PHP fine, but as I understand it, Zend_Mail_Transport_SMTP bypasses that entirely.
     
  17. ENF

    ENF Well-Known Member

    I'm out of suggestions, it's probably time to poke Kier or Mike to see if there is anything else that could be missing.

    XenForo needs a logging bin for mail server issues. Or, a test mail option that reports back the result.

    In the current state, we can't even tell if XenForo is even attempting to authenticate to Google's SMTP service.

    I've looked at this in every way possible and cannot pinpoint anything specifically. I'm still learning the XenForo structure; I don't know it nearly as well as VB (yet).
     
  18. Jeremy P

    Jeremy P Well-Known Member

    Well I appreciate the tries :) I agree, logging would be nice.. hopefully Mike or Kier have some idea what could be going on..
     
  19. Jeremy P

    Jeremy P Well-Known Member

  20. Mike

    Mike XenForo Developer Staff Member

    We could definitely use debugging for this. I did tests with my Gmail account and didn't have any issues sending, but I did routinely make a mistake entering the options. :)
     

Share This Page