Solved

sendmail in perl script

Posted on 2008-06-17
8
234 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
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…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

910 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

22 Experts available now in Live!

Get 1:1 Help Now