1831939 Members
3083 Online
110032 Solutions
New Discussion

Re: Attachments

 
SOLVED
Go to solution
John Booth_1
Advisor

Attachments

I am looking for a mail program that will allow me to attach files to an email. I need it to be a attachment! All the programs I have tried just allow me to append the data from the attachment to the e-mail. Any help would be appreciated.

Thank You,
4 REPLIES 4
Joseph C. Denman
Honored Contributor
Solution

Re: Attachments

How about???

uuencode filename filename | mailx -m -s "Subject" his.name@his.domain.com


...jcd...
If I had only read the instructions first??
linuxfan
Honored Contributor

Re: Attachments

Hi John,

There are multiple ways you can do this.

Joseph already gave one such way.

Elm is another mail program you can use(though it isn't very straight forward or easy). This thread talks about that.

http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x41950559ff7cd4118fef0090279cd0f9,00.html

-HTH
Ramesh
They think they know but don't. At least I know I don't know - Socrates
Sachin Patel
Honored Contributor

Re: Attachments

Hi
Many ways
http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x4be6f9beca68d511abcd0090277a778c,00.html

Sachin

Is photography a hobby or another way to spend $
Gregory Fruth
Esteemed Contributor

Re: Attachments

Perl's MIME::Entity can be used to add MIME attachments
to an SMTP mail message. If your SMTP <-> whatever
mail gateway is halfway decent it ought to be able to
access the MIME attachments. Example:

use MIME::Entity;

$toAddress = 'somebody@somewhere.com';
$body = 'this is the message body';
$filename = 'somefile.gif';
$buf = '';

open(FILE, "<$filename");
while (1) {
last if (read(FILE, $chunk, 65536) == 0);
$buf .= $chunk;
}
close(FILE);

$mime = build MIME::Entity(Type => 'multipart/mixed',
To => $toAddress,
Subject => 'file transmission');
$mime->attach(Type => 'text/plain',
Disposition => 'inline',
Encoding => 'quoted-printable',
Data => $body);
$mime->attach(Type => 'application/octet-stream',
Filename => $filename,
Disposition => 'attachment',
Encoding => 'base64',
Data => $buf);

open(MAIL, "| /usr/sbin/sendmail $toAddress");
print(MAIL $mime->stringify());
close(MAIL);