The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Mail Going Into Spam From PHP

Discussion in 'E-mail Discussions' started by glenelkins, May 19, 2009.

  1. glenelkins

    glenelkins Member

    Joined:
    Aug 31, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Hi

    I have a VPS with cPanel. I am a php programmer and setup alot of web forms using the php mail() function.

    Now usually that would work fine, it would use "sendmail" but since cPanel uses exim it does'nt work quite as expected.

    Every mail sent from a form ends up in the receivers spam/junk/bulk folders even though i set the correct headers in my php

    Iv looked around and it appears as though i need to setup exim to send from a specific "real" domain on smtp rather than from @localhost because thats what is causing spam blockers to catch the mails

    So my question is, how do i setup exim on a cPanel server with specific sending smtp details i choose? I have looked at some documents on Exim, but the cPanel setup has completely different layout to the config files

    Thanks in advance
     
  2. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,384
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
  3. glenelkins

    glenelkins Member

    Joined:
    Aug 31, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Hi

    Nope thats not the issue, i always put the -femail@email.com in the last param
     
  4. glenelkins

    glenelkins Member

    Joined:
    Aug 31, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    how can i change it so the system doesnt send email from nobody@localhost to a proper email address?
     
  5. glenelkins

    glenelkins Member

    Joined:
    Aug 31, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    i dont know if im right but enabling "phpsuexec" should solve the problem right?? It will run php scripts as the owner of the script rather than nobody

    But in WHM when i goto rebuild apache with phpsuexec support, its not in the list!
     
  6. SB-Nick

    SB-Nick Well-Known Member

    Joined:
    Aug 26, 2008
    Messages:
    134
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Hey,

    The script needs to perform a proper SMTP Authentication with the mail server before sending email. There are a lot of explanations on how to do this at PHP level.
     
  7. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,384
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    If the mail is being sent from nobody@localhost then the envelope-sender is not being set correctly.
     
  8. glenelkins

    glenelkins Member

    Joined:
    Aug 31, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Hi

    As a php programmer by profession i understand already that i can program SMTP into the software, but that isnt a realistic option in this case as the issue has only started since i moved about 100 sites that use mailer forms from another host to our own server which i installed cpanel on.

    So how do i set the envelope-sender ?
     
  9. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,384
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    What is the exact mail() line that you are using?

    There may be something on the server that is preventing the PHP script from setting the envelope-sender with sendmail.

    In your php.ini file that is being used with this script, what is the sendmail_path variable set to?

    You may also want to check your exim_mainlog on the server after sending out a message through the PHP script. Find the message id for that particular message then grep the exim_mainlog for that message-id and see if anything relevant is listed.
     
Loading...

Share This Page