Solved

sendmail in perl script

Posted on 2008-06-17
8
233 Views
Last Modified: 2010-03-05
I have this bit of code in my perl script.

open STDOUT,'|sendmail user@domain.com' or die $!

How can change this send an attachment, body as well as subject? Please advise.
0
Comment
Question by:saibsk
  • 3
  • 3
  • 2
8 Comments
 
LVL 28

Expert Comment

by:FishMonger
ID: 21806557
0
 
LVL 48

Expert Comment

by:Tintin
ID: 21806983
Ditto on the MIME::Lite suggestion.
0
 

Author Comment

by:saibsk
ID: 21807068
I can't download any modules on the box. I need to use some unix mail command .....
0
 
LVL 48

Accepted Solution

by:
Tintin earned 250 total points
ID: 21807089
What's the restriction on using modules?

To use sendmail, you do
open MAIL, "|/usr/lib/sendmail -t" or die;

print MAIL <<EOF;

To: some@address

From: someother@address

Subject: My subject
 

Body of the mail

EOF
 

close MAIL;

Open in new window

0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:saibsk
ID: 21807117
I dont' have the perms to dowonload. But in the above code how do i attach the file
0
 
LVL 28

Assisted Solution

by:FishMonger
FishMonger earned 250 total points
ID: 21807184
0
 
LVL 48

Expert Comment

by:Tintin
ID: 21807880
When you say you don't have permission to download, do you mean your company policy disallows it, or you are not connected to the Internet?
0
 

Author Comment

by:saibsk
ID: 21812332
company policy.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

744 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

9 Experts available now in Live!

Get 1:1 Help Now