Solved

I need script for attaching files using sendmail?

Posted on 1998-12-01
4
342 Views
Last Modified: 2012-06-27
I am using perl subroutine in order to sendmail
what should I change or add to this subroutine in order
to sendmail with attachment.

sub mailto
{
($To,$Su,$Bod)=@_;
local($sr)='mailto' ;
open(MAIL,"|/usr/lib/sendmail -t")||die(&logger($sr,"can not open process sendmail"));
print MAIL "To: $To\n";
print MAIL "From: someone\@tase.co.il\n";
print MAIL "Subject: ".$Su."\n\n";
print MAIL "".$Bod ;
close(MAIL);
}
I dont want to use package  as MIME:lite
0
Comment
Question by:tzahi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 

Author Comment

by:tzahi
ID: 1206674
Edited text of question
0
 

Author Comment

by:tzahi
ID: 1206675
Edited text of question
0
 
LVL 5

Expert Comment

by:b2pi
ID: 1206676
sendmail doesn't deal with attachments, per se.  It just sends the text you have given it. It is generally the job of one of the MIME packages to create attachments.  What is your objection to using a package?
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 50 total points
ID: 1206677
check some of your mails how it is constructed using attachements, then `print' this information to MAIL,
finally you have to uuencode (or encode64) your file and print
the result of it to MAIL (don't forget the final attachment string).
That's it.

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question