Hi all,

Thank you so much for your help on the last one, but I've run accross
another snag. The sending of mail goes great, but is slow on my 7600. It
takes about 10 to 12 seconds to run the script. Here is the script:

#!/usr/local/bin/perl

print <<END;
<html>
<head></head>
<body bgcolor=#ffffff>
Sending Mail...<br>
<br>
<img src="../graphics/progress_bar.gif" width=182 height=16>
</body>
</html>
END
;

#================================
# Parse the input from the form =
#================================

read(STDIN,$temp,$ENV{'CONTENT_LENGTH'});
@pairs=split(/&/,$temp);
foreach $item(@pairs)
 {
  ($key,$content)=split(/=/,$item);
  $content=~tr/+/ /;
  $content=~s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
  $fields{$key}=$content;
 }    

#=================================
# Gets rid of the extra carriage =
# returns added in the TextArea  =
# when the form is submitted.    =
#=================================

$fields{message}=~s/\n+//g;

#==========================
# Prepare to send message =
#==========================

use MIME::Lite;

# Set up variables

my $server = 'my.smtp.server';       # Set this variable to your SMTP server
name
my $from = $fields{from}             # From email address
my $to = '[EMAIL PROTECTED]';            # To email address
my $subject = $fields{subject};      # The Subject line in the email
my $mime_type = $fields{mime};       # Text or HTML
my $header = "--------------------------------------------------\nName:
$fields{first_name} $fields{last_name}\n\nEmail:
$fields{from}\n--------------------------------------------------\n\n";
my $message = "$header$fields{message}";      # body of the send message

my $mime_msg = MIME::Lite->new(
>From => $from,
To   => $to,
Subject => $subject,
Type => $mime_type,
Data => $message
)
or die "Couldn't create MIME body: $!\n"; # If you can't create the email,
don't proceed with the rest of the script

# Initiate the mail transaction

MIME::Lite->send('smtp', $server);
$mime_msg->send() or die "Error sending message: $!\n";

#======================
# Send the Auto-Reply =
#======================

# Set up variables

my $from = '[EMAIL PROTECTED]';   # From email address
my $to = $fields{from};                  # To email address (reversed 'From'
emailaddress)
my $subject = 'Thank You - TDS';         # The Subject line in the email
my $mime_type = $fields{mime_ar};        # Text or HTML

# Body od the auto-reply message

my $message = '
<html>
    <head>
        <title></title>
        <style media="screen" type="text/css"><!--
body { color: red; font-size: 12px; font-family: Arial, Helvetica, Geneva,
Swiss, SunSans-Regular; background-color: white }
--></style>
    </head>
    <body bgcolor="#ffffff">
        <table border="0" cellpadding="0" cellspacing="0" width="553"
height="200">
            <tr>
                <td valign="top" width="99%"><br>
                    <br>
                    Thank for your interest. We will get back to you as soon
as possible.
                    <p>TDS</p>
                </td>
            </tr>
        </table>
    </body>
</html>'; # body message for auto-reply

my $mime_msg = MIME::Lite->new(
>From => $from,
To   => $to,
Subject => $subject,
Type => $mime_type,
Data => $message
)
or die "Couldn't create MIME body: $!\n"; # If you can't create the email,
don't proceed with the rest of the script

# Initiate the mail transaction

MIME::Lite->send('smtp', $server);
$mime_msg->send() or die "Error sending message: $!\n";

#==============================
# Send user to thank you page =
#==============================

print "Location: $fields{thank_you}\n\n";

Is there any way to speed MacPerl up?

As a result of this, I am trying to have a progress bar (animated gif) come
up in the window as the mail is sent in the background. When the mail is
done sending, is will call a "thank you" page.

What's happening is the mail gets sent FIRST, then the progress bar comes
up, AS WELL AS the Thank You page doesn't come up, but I get the actual
script printed to the screen, "Location: $fields{thank_you}\n\n".

Any help you could give would be greatly appreciated. If I can get the
script to run in a couple of seconds, I wouldn't need the pregress bar. So
that would be the ideal.

Thanks,

Mark

Reply via email to