Sending to a small list from database - question

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
Metro
Forum Newbie
Posts: 2
Joined: Fri Oct 26, 2007 6:51 am

Sending to a small list from database - question

Post by Metro »

Hello. I have a question re sending to small lists (of less than, say, 100 recipients, every 10 or so minutes as an autoresponder to comments made on a site).

At the moment I load the addresses into an array which prints like (address@domain.com,address@domain2.com,address@domain3.com) and so forth. I then use the php mail() function to BCC all recipients. I think using SwiftMailer would be much better and permit far more customisation... if I can get it to work!

I've read the documentation and played around with it, and it's all great, BUT, I was wondering if the above would work easily with Swift? Can I replace $recipients with a string of addresses? I've hacked away at it with the basic PHP knowledge I have but have had no success.

If this isn't possible (which seems more than likely!), what is the easiest way to batch send a list of addresses from a database? I've had a read of the 'iterators' but just can't seem to get anything to work.

I've got two relevant fields in a database - email and name - and was hoping somebody could post some sample code that they might use themselves to steer a PHP moron in the right direction. I don’t want any functionality beyond the basic send.

Any advice is appreciated.
Metro
Forum Newbie
Posts: 2
Joined: Fri Oct 26, 2007 6:51 am

Post by Metro »

Thanks all. I'm just getting to know the mailer so time (LOTS of time) has given me the opportunity to learn the functionality a little better. There's no need to reply... although I'm sure I'll have questions for you later :)

Mr Chris Corbyn. When you're in Sydney, let me know and I'll buy you a beer, and if you're up for it, take you for a ride it my helicopter over the harbour... not in that order :)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Metro wrote:Thanks all. I'm just getting to know the mailer so time (LOTS of time) has given me the opportunity to learn the functionality a little better. There's no need to reply... although I'm sure I'll have questions for you later :)

Mr Chris Corbyn. When you're in Sydney, let me know and I'll buy you a beer, and if you're up for it, take you for a ride it my helicopter over the harbour... not in that order :)
Wow, thanks 8O :) I'm in Melbourne right now but it doesn't look like I'll be doing my travelling until April now since SitePoint are getting their money's worth on my working holiday visa given that the 4-5-7 visa application is going to be a slow process 8)

Loving Melbourne though, although the level of unpredictability in the weather is quite scary. Today we have hot northerly gale force winds. Hmm...
Post Reply