Solved

I need script for attaching files using sendmail?

Posted on 1998-12-01
4
310 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
  • 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

705 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now