phpgroupware-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-users] Looking for linux command/utility to attach an inl


From: Brian Johnson
Subject: [Phpgroupware-users] Looking for linux command/utility to attach an inline bitmap to email
Date: Wed, 29 Jan 2003 21:27:05 +0000

I would like to create an email from the linux command line (actually a shell
script) that creates an email and attaches a bitmap to it (to send a preview of 
a
received fax)

I have working versions for attaching bmps, pngs, jpgs, gifs, and pdfs but I 
can't
get them to show up in phpgw email as an inline image.  They attach as images, 
but
don't show up as an inline image

I have a feeling that the problem is one of these lines:
echo "Content-Type: application/octet-stream;
name=\"`date`-${id}-page${page}.jpg\";"
echo "Content-transfer-encoding: x-uuencode"

Does anyone have a suggested command, option, or utility to make an inline 
image?

I've been using uuencode like so:
        mailer="/usr/sbin/sendmail -t"
        log "mail to $data"

        (
        # some settings
        tmp=/tmp/`basename $0`.$$
        bound=Newfax_-${$}${$}

        # optionally use the name
        if [ -z "$name" ]
        then
                name=$id
        fi

        # write the mail
        echo "\
Subject: Fax from $name ($pages pages)
From: address@hidden (Fax Subsystem)
To: $data
MIME-Version: 1.0
Content-type: multipart/mixed; boundary=\"$bound\"

--$bound
Content-Type: text/plain;

A new fax has arrived and a jpg has been created

Sender ID:        $id
Name:             $name
Pages:            $pages
"
        for file in $*
        do
                echo $file
        done

        for file in $*
        do
                echo "--$bound"
                page=`echo $file | /usr/bin/awk -F\. '{ printf "%d", $NF }' -`
                echo "Content-Type: application/octet-stream;
name=\"`date`-${id}-page${page}.jpg\";"
                echo "Content-transfer-encoding: x-uuencode"
                echo

                # Attach a 0.5 size jpg (approx 32k)
                /usr/bin/g32pbm $file 2>>$log \
                | pnmscale 0.5 2>>$log \
                | pnmtojpeg 2>>$log \
#               | ppmtojpeg 2>>$log \
                | uuencode -m 2>>$log "`date`-${id}-page${page}.jpg"
                echo
        done
        echo "--$bound--"
        ) | tee /var/log/faxmail | $mailer





reply via email to

[Prev in Thread] Current Thread [Next in Thread]