dFshadow All American 9507 Posts user info edit post |
i have an excel sheet with 3 columns - name, email, and file
i need to send an e-mail to the email in that row, with the file specified in that row
i have a DOS command line program that will send the e-mail - http://www.febooti.com/products/command-line-email/
i wrote a little for loop but i fucked it up Quote : | "FOR /F "tokens=1 delims=," %n IN (Batch1.txt) DO FOR /F "tokens=2 delims=," %e IN (Batch1.txt) DO FOR /F "tokens=3 delims=," %f IN (Batch1.txt) DO febootimail.exe -SMTP myserver.com -PORT 26 -TO "%n <%e>" -BCC me@myserver.com -FROM me@myserver.com -FROMNAME "Me" -SUBJ "Hi you're cool" -ATTACH "%f" -TEXT "you're so cool. check the file to see." -AUTH auto -USER me -PASS mypass -HTMLFILE "email.html" " |
obviously the for loop is fucked up - it sends all the emails to the first person, then all-1 of the emails to the next person, etc. so i researched some more - Quote : | "::== @echo off setLocal EnableDelayedExpansion
for /F "tokens=1-3 delims=," %%a in (batch1.txt) do ( if !name!'==' set name=%%a if !email!'==' set email=%%b if !file!'==' set file=%%c ) echo name is set to !name! echo email is set to !email! echo file is set to !file! ::==" |
this batch script can do this much properly and spit it back out to me but i don't know how to get it to the next line of the file - it only reads one line and then stops
is there something i'm missing like an i++ or something stupid, or is there an easier way to do this using vb macros (i know next to nothing about passing excel vars to the vb macro or anything like that) - all i know is that this command line thing works and i need to send out a few hundred e-mails with pictures attached to them asap
[Edited on September 6, 2008 at 6:52 PM. Reason : [ code ] doesn't break lines...durrrr]9/6/2008 6:51:57 PM |
ScHpEnXeL Suspended 32613 Posts user info edit post |
this is super easy to do in VB in excel.. whatever you're doing in DOS is 100x harder. i have the code at work to do it, i'll show it to you on monday if you haven't found an answer--you should be able to google and figure this out though really 9/6/2008 6:58:41 PM |
ScHpEnXeL Suspended 32613 Posts user info edit post |
basically it's just a loop of selecting a row, setting the email attachment, address and name to the ones in each column, sending, then moving to the next row until it gets to an empty row.
ah shit i'm bored, hold on i'll find some code 9/6/2008 8:25:28 PM |