Re: Mapi and Attachments

2000-05-26 Thread Douglas Wilson

On 05/26/00, ""Elizabeth" <[EMAIL PROTECTED]>" wrote:

> I am not aware of TNEF attachments.  Can you explain, where and how to use
> these attributes?  Is there any document that you could refer, so I can
> read it and understand more.

Try http://msdn.microsoft.com
and search for 'tnef' or 'mapi' or specific tnef
or mapi attributes like 'attattachment' or 'pr_attach_long_filename'.

Display and Sync the table of contents when you bring up
the pages that you find so you can explore things in the
same general subject area.

HTH,
Douglas Wilson

---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
 [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
 [EMAIL PROTECTED]




Re: Mapi and Attachments

2000-05-26 Thread Elizabeth

Thanks for your suggestions;

I am not aware of TNEF attachments.  Can you explain, where and how to use 
these attributes?  Is there any document that you could refer, so I can 
read it and understand more.


Thanks.

---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
 [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
 [EMAIL PROTECTED]




Re: Mapi and Attachments

2000-05-19 Thread Douglas Wilson

On 05/19/00, ""Elizabeth" <[EMAIL PROTECTED]>" wrote:
> I am using MAPI 1.4 version.  I have problem when I retrieve an  attached
> file from a newly read mail.  If suppose the name of the attached file is
> nscript12.exe, the file gets extracted into the directory I point out to,
> but, the filename is not the same as the one I used to attach it. The 
> extract filename seem to be nscript1.exe instead of nscript12.exe.  This
> definitely creates a lot of problem for my automated tool. Any help will be
> greatly appreciated.

Let me first say that I don't have any experience with using
Win32:OLE let alone using it to get at MAPI attributes.
But I do have some experience parsing TNEF attachments, which
seem to have MAPI attributes in them.

The following applies to TNEF attachments I've seen, I don't know
if its the same as what you're dealing with:
The short filename is in the PR_ATTACH_FILENAME attribute which seems
to be the value your getting. The long version of the filename is
supposed to be in the PR_ATTACH_LONG_FILENAME field, but when there's
spaces in the filename (from what I can see), it doesn't always really
have the entire filename. I've always found the whole file name in
the PR_DISPLAY_NAME field. Whether or not any of this helps you in
any way, I don't know, but there it is.

If these really are TNEF attachments, and nothing else seems to help,
you can always try Mail::POP3Client, MIME::Parser, and Convert::TNEF
to get your email and attachments.

Good Luck,
Douglas Wilson

---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
 [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
 [EMAIL PROTECTED]




Mapi and Attachments

2000-05-19 Thread Elizabeth

I am using MAPI 1.4 version.  I have problem when I retrieve an  attached 
file from a newly read mail.  If suppose the name of the attached file is 
nscript12.exe, the file gets extracted into the directory I point out to, 
but, the filename is not the same as the one I used to attach it. The 
extract filename seem to be nscript1.exe instead of nscript12.exe.  This 
definitely creates a lot of problem for my automated tool. Any help will be 
greatly appreciated.

The following code is used to extract the attachments from the read email.

use Win32::OLE qw(in with);
Win32::OLE->Initialize(Win32::OLE::COINIT_OLEINITIALIZE);
$session = Win32::OLE->new('MAPI.Session', 'Quit');

my $err = $session->Logon('Test');  
if ($err) { die "Logon failed:$!";}

$Message = $session->Inbox->Messages;   
$onemsg = $Message->GetFirst;  
 # Get the last message received.
$mail_found = "false";
$file_attached = "false";
$text = "";
while (($onemsg ne "") && ($mail_found eq "false"))
{
  if ($onemsg->Unread) 
 {  
 $text = $onemsg->{Text};   
 $att_files = $onemsg->{Attachments};   
 if ($att_files ne "") 
 {
$file_count = $att_files->{Count}; 
 if 
($file_count >0)
{
  for (my $i = 1; $i <= $file_count; $i++)
  {  
$fname = $att_files->Item($i);
$file = $fname->{Name};
$fname->WriteToFile("c:\\temp\\$file");   
$file_attached = "true";
  }
}
  }   
 $mail_found = "true"; 
}
   else 
   {
  $onemsg = $Message->GetNext;  
   }
}   

**
$file = $fname->{Name};  The filename obtained using this line is the one 
which is displaying the incorrect filename.  This does not happen for all 
attached files.  Has anyone come across this problem.  Please help me.

Elizabeth
 

---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
 [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
 [EMAIL PROTECTED]