jack: (Default)
[personal profile] jack
Suppose I had a spreadsheet with columns name, email, and message, and I have a windows computer and an account on a unix server. What do you think the easiest way to turn that into n emails is?

Date: 2005-04-12 03:26 pm (UTC)
From: [identity profile] mobbsy.livejournal.com
Turn off the windows computer, open the spreadsheet in OpenOffice on the Unix system, save it as CSV, and write a quick script to send the spam.

Date: 2005-04-12 03:28 pm (UTC)
From: [identity profile] cartesiandaemon.livejournal.com
I'm required to have the windows computer running for my job, but otherwise ok :)

Date: 2005-04-12 03:30 pm (UTC)
From: [identity profile] satanicsocks.livejournal.com
Skin it to look like a Mac. Excel can export to CSV though.

Date: 2005-04-12 03:35 pm (UTC)
From: [identity profile] filecoreinuse.livejournal.com
And probably do the mailing via some sick VBA thing. Although is any sensible admin finds a Windows machine sending lots of email via MAPI Jack might find his machine off the network fairly quickly.

Date: 2005-04-12 03:37 pm (UTC)
From: [identity profile] cartesiandaemon.livejournal.com
Well, not *lots*. VBA probably can do it, actually, but for some reason I'm leery of trusting it :)

Date: 2005-04-12 03:38 pm (UTC)
From: [identity profile] satanicsocks.livejournal.com
Actually, I wrote a VBA thing to do exactly that many years ago. Oh for hindsight!

Date: 2005-04-12 03:42 pm (UTC)
From: [identity profile] cartesiandaemon.livejournal.com
Yeah, it probably is one of the standard examples. But it will require me configuring outlook.

Date: 2005-04-12 03:38 pm (UTC)
From: [identity profile] mobbsy.livejournal.com
If you need to do this more than once, you could look at the OOo scripting to automate the .xls -> CSV conversion:
http://udk.openoffice.org/python/python-bridge.html
Some examples or a mostly integrated package that looks like it requires minimal extra scripting.

(All from googling, rather than experience).

Date: 2005-04-12 03:42 pm (UTC)
From: [identity profile] cartesiandaemon.livejournal.com
Probably rarely enough that that wouldn't really be a bottleneck. I think. THanks.

Date: 2005-04-12 03:27 pm (UTC)
From: [identity profile] filecoreinuse.livejournal.com
CSV -> perl script

something like (and I can't remember the API for Mail::SMTP so I might be wrong)


use Mail::SMTP

while(<STDIN>)
{
@fields = split(',', $_);
$mess = new Mail::SMTP::Message;
$mess->to($fields[0].' <'.$fields[1].'>');
$mess->from('Bob');
$mess->body($fields[2]);
$mess->send;
sleep(1);
}


Keep the sleep() call in there unless you want to be killed by your postmaster.

Date: 2005-04-12 03:41 pm (UTC)
From: [identity profile] mobbsy.livejournal.com
Assuming you don't have any commas in the middle of your CSV records. There is a "message" field in [livejournal.com profile] cartesiandemon's spec. Probably safer to use the Perl CSV module.

Date: 2005-04-12 03:48 pm (UTC)
From: [identity profile] filecoreinuse.livejournal.com
Well opviously any code posted into LJ comments is sanity low-passed :).

Date: 2005-04-12 03:51 pm (UTC)
From: [identity profile] cartesiandaemon.livejournal.com
I can easily use something-else separated; or I can recast my sentences to use semicolons; or I could strip up to the second comma ...

Wait, can you have commas in email addresses? :)

Date: 2005-04-12 05:22 pm (UTC)
From: [identity profile] sphyg.livejournal.com
This is why I like TSV.

Date: 2005-04-13 01:13 pm (UTC)
From: [identity profile] cartesiandaemon.livejournal.com
Though there could be an argument for $weird-character-separated, not that I *would* use tabs...

Wait, can you have tabs in email addresses? :)

Date: 2005-05-09 05:25 pm (UTC)
From: [identity profile] sphyg.livejournal.com
Good point. Which is the weirdest character?

Date: 2005-05-09 05:44 pm (UTC)
From: [identity profile] cartesiandaemon.livejournal.com
Well, if you could use unicode... :)