Solved

I need script for attaching files using sendmail?

Posted on 1998-12-01
4
337 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Suggested Solutions

Title # Comments Views Activity
delete query using perl dbi 3 115
Any syntax error for this clone.plscript 6 144
perl script to search for files containing text 3 91
How to get all the API from website? 11 129
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 …
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
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…

726 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