#================================================================ #- Send image #================================================================ # sub send_image { my $message_body; # Adjust sender, recipient and your SMTP mailhost my $from_address = $from; my $to_address = $email; # Adjust subject and body message if ( $testmode ) { $message_body = "Thank you for performing the transfer test. It's good until $msg_body_expdate.

Visit http://www./specialoffer now to take advantage of this exciting special one week offer of 10% off

"; } else { $message_body = "Attached is the chi card you ordered. It's good until $msg_body_expdate."; } my $subject = "Chi-Card delivery service"; # Create the multipart container my $msg = MIME::Lite->new ( From => $from_address, To => $to_address, BCC => $bcc, Subject => $subject, Type =>'multipart/mixed' ) or die "Error creating multipart container: $!\n"; # Add the text message part $msg->attach ( Type => 'text/html', Data => qq{ $message_body } ) or die "Error adding the text message part: $!\n"; # Add the excel file $msg->attach ( Type => 'image/jpeg', #Encodxing => 'base64', Path => $chicardcustomed, Filename => $filename, Disposition => 'attachment' ) or die "Error adding $chicardcustomed: $!\n"; # Now send $msg->send("sendmail") or die "Error e-mailing: $filename.\n"; } #================================================================ #- Send info #================================================================ # sub send_info { # Adjust sender, recipient and your SMTP mailhost my $from_address = $from; my $to_address = $infoemail; # Adjust subject and body message my $message_body = "

The following visitor requested information.

Name: $string
E-mail: $email
"; my $subject = "$string is requesting information."; # Create the multipart container my $msg = MIME::Lite->new ( From => $from_address, To => $to_address, BCC => $bcc, Subject => $subject, Type =>'multipart/mixed' ) or die "Error creating multipart container: $!\n"; # Add the text message part $msg->attach ( Type => 'text/html', Data => qq{ $message_body } ) or die "Error adding the text message part: $!\n"; # Now send $msg->send("sendmail") or die "Error e-mailing: $!\n"; }