SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Wizard
    Join Date
    Mar 2008
    Location
    United Kingdom
    Posts
    1,285
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Avoiding spam folder when using PHP to email?

    Hi,

    I'm having issues with emails sent from my web site not getting to the recipient, but arriving in their Junk/Spam folder.

    Currently I use something not dissimilar to this:

    PHP Code:
    $body "Thank you for signing up. To activate your account, please click on this link:\n\n";
    $body .= "http://www.domain.co.uk/activate.php?x=" mysql_insert_id() . "&y=$a";
    $body .= "\n\nYour temporary password is ".$pass;
    mail($_POST['email'], 'Company Name - Account Confirmation'$body'From: no-reply@domain.co.uk'); 
    Is the chance of this going into Spam greater as I do not have proper headers or I'm missing individualised elements(Hi Bob, etc.) ?

    Anyone know of a more bulletproof method to send these emails. So they have more of a chance to get through to the Inbox.


    Many thanks.

  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)
    'tis a bit of a black art that Michael.

    I usually find avoiding the built in mail function and adopting a library such as swift mailer usually increase your chances of safe delivery.

    You may also want to check your server records to make sure MX et al are all correct as some mail servers validate these too.

    Anthony.
    @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
    Join Date
    Mar 2008
    Location
    United Kingdom
    Posts
    1,285
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Aaaah, good call.

    I've tested the send across some of the different accounts that aren't yet 'activated'(yahoo, hotmail) and they do get through. It's just some go into Spam.

    I'll look into SwiftMailer. Is it a fairly easy install?

  4. #4
    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)
    Doddle.

    A fairly standard set of pure php objects, recently taken over by Fabien Potencier of Symfony fame. Rumour has it - it's to be included in their components collection.

    SwiftMailer.
    @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.

  5. #5
    SitePoint Wizard
    Join Date
    Mar 2008
    Location
    United Kingdom
    Posts
    1,285
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks again Anthony. I will get cracking and see how it goes


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
  •