SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Wizard Zaggs's Avatar
    Join Date
    Feb 2005
    Posts
    1,048
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Some users not receiving emails sent using mail()

    Hi Guys,

    I am having some issues with users not receiving emails sent from PHP function mail(). Some users are receiving the emails and some are not receiving them at all.

    Here are the headers that I am using when sending the mail:

    PHP Code:
    Fromnoreply@mysite.com 
    Reply
    -Tonoreply@mysite.com 
    Return-Pathnoreply@mysite.com 
    Content
    -typetext/html X-MailerPHP/5.2.6 
    Should I add anything else?

  2. #2
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Hi Zaggs,

    From experience, I've found trying comply with every (major) mail servers spam rules almost impossible.

    Have you though about using a mailing library such as SwiftMailer etc? I often find these are far better at getting through spam filters than supplying my own headers.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  3. #3
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  4. #4
    Non-Member thewebhostingdir's Avatar
    Join Date
    Oct 2005
    Posts
    703
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Some mailserver rejects the emails if they are unable to find the smtp authentication attribute in the headers. This might be the case in your issue.

  5. #5
    PHP Guru lampcms.com's Avatar
    Join Date
    Jan 2009
    Posts
    921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What is this:
    Content-type: text/html X-Mailer: PHP/5.2.6

    Do you have 2 headers on 1 line? This is bad

    I recommend to remove X-Mailer header completely.

    Also try to send in plaintext format and see if that helps


Bookmarks

Posting Permissions

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