View Issue Details

IDProjectCategoryView StatusLast Update
0001538JEDI VCL00 JVCL Componentspublic2004-04-09 09:20
ReporteranonymousAssigned Toremkobonte 
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0001538: jvMail - wrong attachment filenames
DescriptionWhen attaching files, the attached file is shown with full directory structure at the receiver.
Only filename should be set.
Additional InformationI have a solution Line :

 procedure MakeAttachments;
  var
    I: Integer;
    Fil: array [0..256] of char; //*******************
  begin
    if Attachment.Count > 0 then
    begin
      SetLength(FAttachArray, Attachment.Count);
      for I := 0 to Attachment.Count - 1 do
      begin
        if not FileExists(Attachment[I]) then
{$TYPEDADDRESS OFF}
          raise EJclMapiError.CreateResRecFmt(@RsAttachmentNotFound, [Attachment[I]]);
{$TYPEDADDRESS ON}
        FillChar(FAttachArray[I], SizeOf(TMapiFileDesc), #0);
        FAttachArray[I].nPosition := $FFFFFFFF;
        StrPCopy(Fil, ExtractFileName(FAttachment[I])); //***********************
        FAttachArray[I].lpszFileName := Fil; //*************
        FAttachArray[I].lpszPathName := PChar(Attachment[I]);
      end;
    end
    else
      FAttachArray := nil;
  end;
TagsNo tags attached.

Relationships

has duplicate 0001621 resolveduser72 Attachments don't work with TJvMail 

Activities

remkobonte

2004-03-30 14:05

developer   ~0003528

Yeah, that makes sense and is also the default behaviour if you pass nil to lpszFileName.

I think there is a problem with your code if you have multiple attachments; the lpszFileName fields will all point to the same address: to Fil. Fil is filled with the last attachment name.

cab-dk

2004-04-03 00:16

reporter   ~0003614

I can see your point, but the lpszFilename has to be a filename without directory information - do you or anyone have a solution?

When sending attached files, these files are appearing at the receivers mailbox with full directory structure. In my oppinion only the filename should appear.

remkobonte

2004-04-04 13:50

developer   ~0003635

I agree with you that the receiver should not see the complete directory structure, so this will be changed.

Weird thing is that I could not reproduce it. That is, I could not see the full directory structure in the mail message by using the unchanged code, or by setting lpszFileName to nil or something. I tested with Outlook and Mozilla.

But to be safe I'll change the code.

remkobonte

2004-04-09 09:20

developer   ~0003755

Fixed in rev. 1.10, see http://cvs.sourceforge.net/viewcvs.py/jvcl/dev/JVCL3/run/JvMail.pas

Thanks :)

Issue History

Date Modified Username Field Change
2004-03-28 11:37 anonymous New Issue
2004-03-29 13:04 remkobonte Status new => assigned
2004-03-29 13:04 remkobonte Assigned To => remkobonte
2004-03-30 14:05 remkobonte Note Added: 0003528
2004-04-03 00:16 cab-dk Note Added: 0003614
2004-04-04 13:50 remkobonte Note Added: 0003635
2004-04-09 09:20 remkobonte Status assigned => resolved
2004-04-09 09:20 remkobonte Resolution open => fixed
2004-04-09 09:20 remkobonte Note Added: 0003755
2004-04-10 13:39 user72 Relationship added has duplicate 0001621