#1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2004
    Location
    Boston, MA USA
    Posts
    530
    Rep Power
    50

    Mail / Spam and PHP mail() functions


    Hi:

    Not sure if this is the right spot for this because it's sort of a programming question but really about mail standards...

    I have a PHP/MySQL based CRM that has an email "blast" function that cycles through a list of addresses and sends an email to each one, using the PHP mail() function.

    My customers have individual accounts on my system for managing business applications. They send out emails to their customers with their own business name and return email address.

    It seems to work fine, but for some recipients, the mail is being trapped by spam filters. Part of the reason may be because:
    • The mail server is my hosting service, (bizland.com)
    • the php mail sender is on my domain on the hosting company server (abc.com)
    • the "from" return address is another domain altogether (joe@xyz.com)


    Is there a way if minimizing the number of emails trapped by spam filters?

    If I look at the raw source of a received email it looks like this: (I have changed my domain name to "abc.com" and the sender's return address to "123.com")
    Return-Path: <bounce-cgi-abc@yourhostingaccount.com>
    Return-Path: <bounce-cgi-abc@yourhostingaccount.com>
    Delivered-To: sean@customer.com
    Received: from walmailscan01.int.bizland.net by walmailscan01.int.bizland.net (Dovecot) with LMTP id Us9UBe++iFe1cAAAUsKWxQ for <sean@customer.com>; Fri, 15 Jul 2016 06:47:10 -0400
    Received: from [10.114.3.31] (helo=walimpout11) by walmailscan01.yourhostingaccount.com with esmtp (Exim) id 1bO0eE-0002eF-Tm for sean@customer.com; Fri, 15 Jul 2016 06:47:10 -0400
    Received: from walcustweb2206.yourhostingaccount.com ([10.1.112.135]) by walimpout11 with id Jyn71t00B2vKkaJ01ynAtX; Fri, 15 Jul 2016 06:47:10 -0400
    Received: from 123 by walcustweb2206.yourhostingaccount.com with local (Exim) id 1bO0dg-0005a4-2E for sean@customer.com; Fri, 15 Jul 2016 06:46:36 -0400
    Envelope-To: sean@customer.com
    Delivery-Date: Fri, 15 Jul 2016 06:47:10 -0400
    X-Authority-Analysis: v=2.1 cv=UMFTHUvy c=1 sm=1 tr=0 a=0I5d2VPu+S0ukAEI24vD9w==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=bFcGvqQMjHwA:10 a=8nJEP1OIZ-IA:10 a=VycyukZyKCIA:10 a=cAmyUtKerLwA:10 a=3Yzog2mfUsSwD6z9JyoA:9 a=fEO6dEIAI1qCF110:21 a=wPNLvfGTeEIA:10 a=_W_S_7VecoQA:10
    X-En-Info: U=abc P=/new_email_blast.php
    X-En-Cgiuser: abc
    X-En-Cgipath: /new_email_blast.php
    X-En-Origip: 98.118.43.171
    Message-Id: <1468579596-555-abc@walcustweb2206.yourhostingaccount.com>
    X-Php-Originating-Script: 4303246:new_email_blast.php
    Mime-Version: 1.0
    Content-Type: text/html; charset=iso-8859-1
    X-En-Timestamp: Fri, 15 Jul 2016 06:46:36 -0400
    Sender: Joe <joe@123.com>
    Test Email A
    Is the discrepancy between the various domains a problem?
    is the "yourhostingaccount" a flag?
    Anything else I should be concerned with?

    Thanks!
  2. #2
  3. Lazy Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,436
    Rep Power
    9645
    Your clients should set up SPF information to allow your mail server to officially send on their domain's behalf. It's really easy: they add a DNS record to their domain that identifies your mail server and that's it. You don't need to do anything on your side, other than maybe write some documentation or a how-to about it. When emails are received by knowledgeable servers, they examine the SPF records on the domain the email claims to be from to decide whether the email is more trustworthy.

    Even better would be using SPF and DKIM, but DKIM is more complicated: they add a more complex DNS record than SPF's, and you write code to support it (because it involves adding header to the email). At that point you should switch to an emailing library rather than using mail() directly.

    Besides those, make sure your emails contain all the headers that a good email should: sender, paths, dates, metadata... I don't know of a list you could look at but I think you got the major ones already. (Could look at an email sent from Gmail or something to see what they include.)
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2004
    Location
    Boston, MA USA
    Posts
    530
    Rep Power
    50
    Thanks so much... this looks very helpful. I will investigate the best way to implement!

    Thanks again.

IMN logo majestic logo threadwatch logo seochat tools logo