Solved

I need script for attaching files using sendmail?

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
cpan issue 1 64
git fat pull happens nothing in centos 6.3 python 2.6.6 33 218
Exchange 2010 Transport Rule Regex 28 108
Formatting stings with pack and printf in perl 5 73
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 …
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
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…

825 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