What I use is the custom tag "advancedemail.cfm" to write the file and then
I use this script that I have writen. it has been tested up to 5000 emails.
I hope it is useful for you.

--------- Start of script --------------------------

#!/bin/bash

# this is for checking a folder to see if there is any files is there
# and to send it out by email.
# written by P.V.Anthony
# [EMAIL PROTECTED]

# the path you want to run this script
path=/home/massemail/MassMailSpool/

# number of files to mail out at runtime
numFiles=200

# check for files in the directory
file=`ls -tr $path | grep -v ".CANNOT" | head -$numFiles`


# once the directory is checked for files and if no files are found then
exit,
# or if files are found then send them out one at a time.
if [ -z "$file" ]
then
        exit
else

# counter for counting the number of emails sent
counter=0

# Mail out one file at a time
for file in $file
        do
                # using the -i option because it was recommended in the man
pages for sendmail
                # something to do with dots.
                # using the -t option for reading to and from fields in the
text files
                # using the -ba option so that the return-path will be set
to the from field
                # this is useful so that when there is a bounce email it
will go the sender
                /usr/sbin/sendmail -ba -t -i  < ${path}${file}

                # did the last command exit ok
                CommandStatus=$?

                if [ $CommandStatus -eq 0 ]
                then
                        # this will increase the counter by 1 for every
email sent
                        let counter=counter+1

                        # the grep command will look for "To:" or "From:".
                        # This is done by using \| in between the two words.
                        echo "$counter:"`grep -w "To:\|From:"
${path}${file}`

                        # remove the file after it has been sent out
                        rm ${path}${file}
                else
                        mv ${path}${file} ${path}${file}.CANNOT
                fi


        done
fi

exit

--------------- end of script --------------------------------

If you improve this script please send me a copy.

P.V.Anthony


----- Original Message -----
From: "Dave Wilson" <[EMAIL PROTECTED]>
To: "CF-Linux" <[EMAIL PROTECTED]>
Sent: Friday, March 14, 2003 5:40 PM
Subject: RE: CF5 on RH 7.2 running very unreliably


> Mark,
>
> In answer to your idea of dropping cfmail altogether for a better
> alternative, you could simply compose your emails manually (with some
script
> of course) and drop them directly into the spool directory of your MTA
using
> cffile.
>
> I've done this before on a Windows/Imail combo a few years ago when cfmail
> simply did not cut it on CF4.x. I'm not yet up to scratch on linux MTA's
to
> be able to give you precise instructions, but I'm sure it's fairly
> straightforward providing you compose your email with the correct headers
> etc. Thereafter it's simply a matter of finding out where the spool/queue
is
> of your preferred MTA (sendmail,exim,etc).
>
>
> HTH,
> Dave
>
>
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=14
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=14
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.14
                                

Reply via email to