Closed Thread
Results 1 to 4 of 4

Thread: Don't use mail()?

  1. #1
    bruder is offline Newbie
    Join Date
    Nov 2006
    Posts
    2
    Rep Power
    0

    Don't use mail()?

    In school we were told not to use the mail() function for mass mailing. I didn't understand the reason why not with the looping or something like that (please explain if you know why). What other options do I have in order to mail about 5,000 users?

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Jordan Guest
    I've read that is uses more resources and is slower but I can't find any articles about it. I know that the mail() function can be used in Email Injection hacks as well.

  4. #3
    CygnetGames's Avatar
    CygnetGames is offline Programmer
    Join Date
    May 2007
    Location
    York, England
    Posts
    119
    Rep Power
    0
    It's because of "email injection attacks".
    This is where someone using your website abuses your email form to send mail to whoever they want. The PHP mail() function is particularly vulnerable to this - which is why you will have been told not to use it.

    It is safe to use it if you understand how injection attacks work and you know how to validate your input. At school, they probably didn't want to take the time to teach you about injection/security/validating input, and they would have to make sure that you all understood in perfectly before letting you put webpages on the internet with potentially vulnerable mail scripts in them.

    If you want to send email but don't want the headache of doing the security yourself, there are some packages that will handle the security for you. Zend_Mail, Swift and Pear Mail will do this.

    See this page for some more info:
    Email Injection - SecurePHP

  5. #4
    NeedHelp Guest
    I've never heard this and always used mail() blindly. Thanks for the info!

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. c++ mail
    By sh4 in forum C and C++
    Replies: 6
    Last Post: 01-12-2011, 11:38 PM
  2. Any mail OS?
    By Scuby in forum PHP Development
    Replies: 7
    Last Post: 07-30-2010, 04:30 PM
  3. Sending mail
    By harkoslav in forum C and C++
    Replies: 8
    Last Post: 07-29-2010, 03:26 AM
  4. I need help with mail()
    By Xhris in forum PHP Development
    Replies: 12
    Last Post: 11-18-2008, 09:32 PM
  5. Php Mail
    By Jaan in forum PHP Development
    Replies: 4
    Last Post: 07-17-2008, 04:26 AM

Tags for this Thread

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