Re: [Exim] php & exim for newsletter bulk mail

Pàgina inicial
Delete this message
Reply to this message
Autor: Tim Jackson
Data:  
A: exim-users
CC: James Fassett
Assumpte: Re: [Exim] php & exim for newsletter bulk mail
Hi James, on Thu, 5 Jun 2003 11:10:57 -0700 you wrote:

> Tim Jackson wrote:
> > Create all the mails in PHP but instead of calling mail() or doing it
> > via SMTP, create one big BSMTP file.

<snip about syntactically valid addresses>
> I like this solution (it is in fact what I was hoping for), however the
> 'point of origin' thing is sticky.
> There are 2 peices to the system
>     1) mass mailer
>     2) news letter


It's not immediately obvious to me what each "piece" is and what the
difference is here.

> I can verify addresses for the news letter, but not for the mass mailer.


Ditto. However, if necessary, you can check the syntax at the point of
generating your BSMTP file and throw away bad addresses (or notify someone
about them). It'll slow it down a bit but it shouldn't be *too* bad. Or do
a half-reasonable regex, as below:

> Any chance a regular expression would do the job, or do you mean I need
> to verify the validity beyond string verification?


A fully RFC-compliant regex is very long, but in reality for your purposes
you can probably come up with something fairly simple. Anyway, this is
only a problem if you are using BSMTP to do multiple confirmation
mailouts, for reasons discussed below.

> any good resources on building bsmtp files?
> I couldn't find any myself.


Just use it like SMTP, but write it to a file. If you use my class it's
easier than easy:


// Assume $Recipients is an array of recipients

$BSMTP = new BSMTP();

foreach ($Recipients as $Recipient) {
  // fill $Msg with whatever you want to say
  $BSMTP->addMail(
    $Recipient, // duh
    'My great newsletter', // subject
    $Msg, // the message
    'myco@???', // envelope sender
    'From: My Company <myco@???>\n'.
    'X-Mailer: SuperMegaXtraCoolMailer v9234.12'
  );
}


$BSMTP->sendQueue();

> Although I like the idea, I am concerned about the 'failing part-way
> through' clause. Checking 10,000 addresses by evoking exim from flash
> on each is as slow as passing each email to exim one at a time.


Is there no way to devise a system where at the point that addresses get
added to your database (or whatever) they are syntax checked? Either way,
you're hopefully sending out a confirmation with embedded token on signup,
so if you only mail to confirmed addresses, you shouldn't have a problem
(because the addresses will, inherently, be syntactically valid if you
managed to send/receive a confirmation).


Tim