1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Need PHP mail sending functon/code that will go to inbox (not in spam or junk box)

Discussion in 'PHP' started by KingCobra, Jul 10, 2012.

  1. #1
    Dear friends,

    I need a PHP mail sending functon/code that will go to inbox (not in spam or junk box).

    I want to use it to my site user registration system.

    Please help me.

    Thanks
     
    KingCobra, Jul 10, 2012 IP
  2. mattgos

    mattgos Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    PHP code is not involved here, emails dropping into spam/junk is because of your server configuration.

    Try using Gmail SMTP, but it limits to 500 mails/day.

    Or you can try installing postfix and follow some guidelines about hostname and domain configuration.

    Yet another solution, you can rent 3rd party for sending emails.

    I'm new to forum so I cannot put the links here, please google!
     
    mattgos, Jul 10, 2012 IP
  3. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #3
    The control of where any particular email goes is in the email program, you have no control over that. Any user can simply set your address, or a word you use in your emails, to go to his spam folder.

    How do you prevent this? You don't send spam email.

    Contrary to what mattgos says, it has nothing to do with the server. I can send anything from any gmail account to my spam folder. I can even have it delete before I see it. (Any emails I get with dollar signs in the subject get deleted. So do about 30 other typical spam formats.)

    The days of forcing people to read your emails have been over for years now, so change your business model.
     
    Rukbat, Jul 13, 2012 IP
  4. extraspecial

    extraspecial Member

    Messages:
    788
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    45
    #4
    It's not actually about your code but the way you sent it, PHP mail is an option where it ends up in SPAM most time, but if you use SMTP with a good provider you will be able to hit the INBOX. I would recommend SendGrid they have advanced system and gives 200 free emails per day.
     
    extraspecial, Jul 19, 2012 IP
  5. workingsmart

    workingsmart Well-Known Member

    Messages:
    411
    Likes Received:
    12
    Best Answers:
    9
    Trophy Points:
    120
    #5
    You should also format the headers for the emails you are sending - If your headers are configured then you shouldn't wind up in the "spam" folder UNLESS a user sets filters, like Rukbat does... :)
    For Example....
    
    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    
    $headers .= 'To: Person <person@people.com>, Another One <metoo@somewhere.com>' . "\r\n";
    $headers .= 'From: My Name <myemail@address.com>' . "\r\n";
    $headers .= 'Cc: ' . "\r\n";
    $headers .= 'Bcc: ' . "\r\n";
    
    Code (markup):
     
    workingsmart, Jul 20, 2012 IP
  6. BRUm

    BRUm Well-Known Member

    Messages:
    3,086
    Likes Received:
    61
    Best Answers:
    1
    Trophy Points:
    100
    #6
    Actually, the programmer can have a degree of control over this. It may be that additional headers are missing. Some servers also require a "replyto: ".

    Read about additional headers here: http://uk.php.net/manual/en/function.mail.php

    It may help.
     
    BRUm, Jul 21, 2012 IP