Page 1 of 1

Using Swift to send messages which already have headers

Posted: Sun Jul 12, 2009 3:33 pm
by ntm
I'm currently working on a mailing list manager of sorts. Registered users will be able to send an e-mail to a particular address, from which a PHP script will retrieve their e-mail, check their credentials, and then distribute that e-mail to a number of other users.

I don't want to have to parse the original e-mail, split it into its constituent parts, and rebuild it with Swift; I'd rather just take the message as it has been received, remove/modify some of the message headers, and leave the rest intact (including MIME boundary definitions etc.), so: is there a way of using the Swift library to send a prepared message of this kind?

I should add that the reason why I don't just use PHP's mail() is because hundreds of e-mails will be sent, and as I understand it, mail() will keep opening and closing the SMTP connection, while Swift won't (and I can't rely on PEAR because I don't want to have to persuade my webhost to install the necessary packages).

I'd be grateful for any advice (even if it's "no, can't be done")!