![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| mailx commannd - Mail and Attachment in same mail | sharif | UNIX for Advanced & Expert Users | 6 | 03-19-2008 04:25 PM |
| HTML message with attachment (text-file) | Felix2511 | UNIX for Dummies Questions & Answers | 2 | 09-12-2007 02:59 AM |
| Problem while sending message and attachment with mailx | nihar.dutta | Shell Programming and Scripting | 2 | 08-09-2007 11:15 AM |
| AIX send mail with HTML message body and a binary attachment | G-Man | UNIX for Dummies Questions & Answers | 4 | 03-22-2007 02:15 PM |
| email attachment, with a message using mailx | edog | UNIX for Advanced & Expert Users | 4 | 09-28-2001 01:03 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
mail message attachment not complete
Hi,
I use MIME::Lite to send an e-mail with an attachment: $msg = MIME::Lite->new( From =>$usermail, To =>$tomail, Subject =>'Nieuw Pegasus Adresboek', Type =>'multipart/mixed' ); $msg->attach(Type =>'TEXT', Data =>$message ); $msg->attach(Type =>'text/plain', Path =>'/home/ldap/data/tine/pm_hva.txt', Filename =>'pm_hva.txt', Disposition => 'attachment' ); $str = $msg->as_string; $msg->print(\*SENDMAIL); The problem is that the attachment is not sent complety. It stops somewhere near the end of the file. In the file i can't find anything strange and also it happens at different lines/locations in the file.. Can anyone please help? Tine |
|
||||
|
since you are useing single quotes it might not interperate the PATH correcly. try useing double quotes.
from the POD http://search.cpan.org/~yves/MIME-Li...t_to_a_message Code:
### Create the multipart "container":
$msg = MIME::Lite->new(
From =>'me@myhost.com',
To =>'you@yourhost.com',
Cc =>'some@other.com, some@more.com',
Subject =>'A message with 2 parts...',
Type =>'multipart/mixed'
);
### Add the text message part:
### (Note that "attach" has same arguments as "new"):
$msg->attach(Type =>'TEXT',
Data =>"Here's the GIF file you wanted"
);
### Add the image part:
$msg->attach(Type =>'image/gif',
Path =>'aaa000123.gif',
Filename =>'logo.gif',
Disposition => 'attachment'
);
|
|
||||
|
I found out what was causing the problem..
The file i was trying to send was made in the same script before sending it: foreach $key (@keys){ print pegasus_file $temp_naam{$key}; } and i didn't close the file.. so it seemed to send the file before it was filled completely! a simple close(pegasus_file); solved all my worries! ![]() |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|