Avatar of Thom McCarthy
Thom McCarthyFlag for United States of America

asked on 

Embarrassing Email Question

This is embarrassing, but that's never stopped me before.
I've been using the same chunk of code to send simple acknowledgement emails from a script for a long time (it works).
I know it's not MIME:, but I don't know if its SENDMAIL, or what.
I wanted to add an attachment to this, but it's looking as if this isn't the format inwhich to do it.
So the question is - what kind of MAIL is used below, and will it allow attachments
#####################################################
 if (open(MAIL,"|mail tmccar10\@ford.com")){                
          print "Emailed to Decision Support!\n<BR>";
          print MAIL "\n";
          print MAIL "Name: $Q::name (PROFS ID: $Q::profsid) has submitted the following request for a NEW report on $date\n";
          print MAIL "Department: $Q::deptno\n";
...
}
else {
      print "Open to mail failed!\n<BR>";      
}
            close(MAIL);
Perl

Avatar of undefined
Last Comment
Thom McCarthy
ASKER CERTIFIED SOLUTION
Avatar of Tintin
Tintin

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Thom McCarthy
Thom McCarthy
Flag of United States of America image

ASKER

Thanks TIn TIn-

I'm aware of MIME, I don't think I understand it very well.
One question, if I can prevail on you.
I want to use this to give information to a another user that was collected on a form.
Like $Q::Name;
       $Q::Address;
I don't see where I list those. Is it "data=>?
Avatar of Tintin
Tintin

Yes, it goes in the data section ,eg:

my $text = <<EOF;
Emailed to Decision Support!<BR>

Name: $Q::name (PROFS ID: $Q::profsid) has submitted the following request for a NEW report on date
Department: $Q::deptno
EOF

my $msg = MIME::Lite->new(
                 From     =>'user@ford.com',
                 To       =>'tmccar10@ford.com',
                 Subject  =>'Your subject',
                 Data     => $text
                 );

$msg->send or die "Can not send mail $!\n";
Avatar of Thom McCarthy
Thom McCarthy
Flag of United States of America image

ASKER

Thanks, Tin Tin, as always.
Perl
Perl

Perl is a high-level, general-purpose, interpreted, dynamic programming languages with over 25 years of development. Perl 5 runs on over 100 platforms from portables to mainframes and is suitable for both rapid prototyping and large-scale development projects. Perl gained widespread popularity as a Common Gateway Interface (CGI) scripting language, in part due to its regular expression and string parsing abilities. In addition to CGI, Perl is used for graphics programming, system administration, network programming, finance, bioinformatics, and other applications.

26K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo