SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 2009
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How should I build the auto e-mail structure of my website.

    Hi,

    I'm coding this new website where I expect to send a bunch of transactional e-mails to users every day.(User validations, updates, etc...).


    I don't feel safe relying on the mail() function of php. Am I wrong, can I totally rely on the mail() function?

    Or should I use another mailing structure. Maybe I should send e-mails using a perl script? Or is there a well known best practice for this case.

    Thank you!

  2. #2
    SitePoint Evangelist
    Join Date
    Mar 2006
    Location
    Sweden
    Posts
    451
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Take a look at Swift Mailer, http://swiftmailer.org. It doesn't rely on PHPs own mail function, and it's very flexible.
    I would also advise you to set up a mail queue instead of sending emails directly. That is, when a user registers, insert a mail into a queue. Set up a cron job that runs every minute or so that takes 100 queue items from the mail queue and sends them.
    Separating things like that can take some stress of the mail server, and it also lets you test the different parts in isolation. You can test that a user can register and that an item is placed in the queue, without actually sending an email. You can also put checks in the cron job to make sure that identical emails aren't sent to the same person.

  3. #3
    SitePoint Member
    Join Date
    Aug 2009
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's great advice! I'll definitely setup swiftmailer and see if it does the job for me. I've read their website and I'm pretty sure it will work just fine.

    Thanks again!


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
  •