Link to home
Start Free TrialLog in
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);
ASKER CERTIFIED SOLUTION
Avatar of Tintin
Tintin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Thom McCarthy

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";
Thanks, Tin Tin, as always.