php mail script

Discussion in 'PHP' started by Garret, Apr 25, 2010.

  1. #1
    hello good people. I'm here searching for some good php script to send a mail. I've looked on the internet for a script with some security ( to protect me against spam ). I've made the validation with the jquery validate plugin. works well, but now I've to add some code to send emails. does anyone knows a place with script samples or tutorials?


    thanks in advance,
     
    Garret, Apr 25, 2010 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,901
    Likes Received:
    4,555
    Best Answers:
    123
    Trophy Points:
    665
    #2
    sarahk, Apr 26, 2010 IP
  3. intizam

    intizam Member

    Messages:
    151
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
  4. techbongo

    techbongo Active Member

    Messages:
    309
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    80
    #4
    techbongo, Apr 26, 2010 IP
  5. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #5
    danx10, Apr 26, 2010 IP
  6. nolag

    nolag Member

    Messages:
    201
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    28
    #6
    I use PHP mail() all the time and even when I mess up and forget the header (or once I forgot the from email), it did not go into spam. I have tried on Gmail, Yahoo and Hotmail.
     
    nolag, Apr 26, 2010 IP
  7. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #7
    PHP's mail() is certainly not to be relyed upon, as not in all cases will the email be recieved within the inbox, I've seen many cases where the email's land within the spam/junk folder. Also many host's nowadays have a limit on the usage, (theirfore could prevent sending newsletters etc.. to your members)

    When it does end up in the inbox, its probably because it fits a certain criteria of the reciepients email provider, such as the server where the email is coming from is reputable (not blacklisted), the email does'nt trigger the spam filter (does'nt contain common words which are within a spam email), the email headers are defined correctly ( http://www.transio.com/content/how-pass-spam-filters-php-mail ) etc.
     
    danx10, Apr 26, 2010 IP
  8. Gray Fox

    Gray Fox Well-Known Member

    Messages:
    196
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    130
    #8
    PHPMailer or Zend_Mail, both with SMTP option, of course.
     
    Gray Fox, Apr 26, 2010 IP
  9. techbongo

    techbongo Active Member

    Messages:
    309
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    80
    #9
    See, I'm not sure if PHPMailer is using cUrl for both authenticating and sending mails or not, but I realize, you don't need to send mails from PHP script only after smtp authentication. It depends on your requirement.

    Example?
    You have a publicly accessible form in your site, which sends mail. Use SMTP for this case. Never allow a real spammer to play around!

    But, when sending a registration confirmation email (when a successful registration takes place on your site), you don't need an SMTP authentication.

    AND FOR YOUR QUESTION, "WHO TOLD"... No one told. I tested it and used in practice. If mail() function used with proper header (specifically the From: field of email header should be an email id from the domain, where the current script is hosted), some really strong filters won't block your mails. IT'S A GUARANTEE!!! Not even Gmail, Live, Yahoo, AOL, IN emails, but also no paid mailbox will mark it as spam.

    A CONDITION IS STILL THERE: Some custom filters of very busy mail ids are configured more cleverly. They filter all emails from a or kind of email ids. They even truncate all emails with a subject like, that contains the term "Newsletter" or "LUCKY WINNER" or "Invitation" etc. So, you always get the option to customize your automated emails. Never use generic keywords in subject; if possible do not use no-reply mail ids (which email ids are not monitored or even do not exist) for sending mails.

    AND, for sending newsletter, a PHPMailer script can't do a miracle. Never, ever think of sending thousands of mail at a go from your shared or even VPN servers. Your provider seldom allow you to send more than 500-600 mails per hour from these servers. For this use some custom solutions, specially created for sending bulk mails. SMTP authentication is no how related to newsletter sending.ac
     
    techbongo, Apr 27, 2010 IP
  10. techbongo

    techbongo Active Member

    Messages:
    309
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    80
    #10
    One thing I must add here:
    Remember, if the domain (or the IP, where the domain is hosted) is blacklisted already, nothing can help. Neither mail() function, nor SMTP authentication, nothing will work. Even an email authenticated by a blacklisted SMTP server, will be identified as SPAM. So, please avoid bulk mailing activity from shared or virtual-private environment.
     
    techbongo, Apr 27, 2010 IP
  11. majin22

    majin22 Peon

    Messages:
    62
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    I personally suggest PHPMailer, I have used it and have been sing it for a lot of clients and personal site and it hasn't let me down yet :)
     
    majin22, Apr 27, 2010 IP