Board index » delphi » Message Not Displayed

Message Not Displayed


2004-05-28 11:52:42 PM
delphi233
Greetings All
Using 9.0.14 idPOP on Delphi 6
Using both the MailDemo and my own (very similar)
I can connect and retrieve the message headers,
but when I double click to read the mail message it is blank ??
In looking at the message source (using outlook) I see the first line is
blank
Date: Thu, 27 May 2004 14:55:15 -0400
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0001_01C443FA.9EBDCB60"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
This is a multi-part message in MIME format.
------=_NextPart_000_0001_01C443FA.9EBDCB60
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
Virtual folder
PkgT-1
NOTE the blank line before Virtual folder and after Content-Transfer......
Can anyone shed light on this and why is the message blank ??
Thanks in Advance
Barry
 
 

Re:Message Not Displayed

"Barry Fawthrop" <XXXX@XXXXX.COM>writes
Quote
NOTE the blank line before Virtual folder and after
Content-Transfer......
That is how it should be.
You did not mention how you are trying to show the message in the first
place. Please show that code as well.
Gambit
 

Re:Message Not Displayed

"Barry Fawthrop" <XXXX@XXXXX.COM>writes
Quote
Content-Transfer-Encoding: quoted-printable
BTW, which flavor of 9.0.14 are you using? Indy 9 had problems with
quoted-printable messages for awhile.
Gambit
 

Re:Message Not Displayed

"Barry Fawthrop" <XXXX@XXXXX.COM>writes
Quote
I downloaded the 9.0.14 last week so it would be the latest I guess
The latest is updated daily.
Quote
Code is the Indy Demo Source code for MailDemo
... which I don't have onhand...
Quote
Yet it still won't show the messages at all?
That doesn't say anything meaningful. Will you please just show the code
you are using?
Gambit
 

Re:Message Not Displayed

"Remy Lebeau (TeamB)" <XXXX@XXXXX.COM>writes
Quote
Will you please just show the code you are using?
And also the FULL message is is failing.
Gambit
 

Re:Message Not Displayed

Thanks Gambit
I downloaded the 9.0.14 last week so it would be the latest I guess
Code is the Indy Demo Source code for MailDemo
Yet it still won't show the messages at all?
Thanks in advance
Barry
"Remy Lebeau (TeamB)" <XXXX@XXXXX.COM>writes
 

Re:Message Not Displayed

Thanks
I reInstalled 9.0.14 from today and it still fails
Here is the section called from the demo source
procedure TfrmMain.RetrieveExecute(Sender: TObject);
var
stTemp: string;
intIndex: Integer;
li: TListItem;
begin
stTemp := Statusbar1.Panels[1].text;
if lvHeaders.Selected = nil then
begin
Exit;
end;
//initialise
Showbusy(true);
Msg.Clear;
Memo1.Clear;
lvMessageParts.Items.Clear;
From.Caption := '';
Cc.Caption := '';
Subject.Caption := '';
Date.Caption := '';
Receipt.Caption := '';
Organization.Caption := '';
Priority.Caption := '';
pnlAttachments.visible := false;
//get message and put into MSG
ShowStatus('Retrieving message "' +
lvHeaders.Selected.SubItems.Strings[2] + '"');
POP.Retrieve(lvHeaders.Selected.Index + 1, Msg);
statusbar1.Panels[0].text := lvHeaders.Selected.SubItems.Strings[2];
//Setup fields on screen from MSG
From.Caption := Msg.From.Text;
Recipients.Caption := Msg.Recipients.EmailAddresses;
Cc.Caption := Msg.CCList.EMailAddresses;
Subject.Caption := Msg.Subject;
Date.Caption := FormatDateTime('dd mmm yyyy hh:mm:ss', Msg.Date);
Receipt.Caption := Msg.ReceiptRecipient.Text;
Organization.Caption := Msg.Organization;
Priority.Caption := IntToStr(Ord(Msg.Priority) + 1);
//Setup attachments list
ShowStatus('Decoding attachments (' + IntToStr(Msg.MessageParts.Count) +
')');
for intIndex := 0 to Pred(Msg.MessageParts.Count) do
begin
if (Msg.MessageParts.Items[intIndex] is TIdAttachment) then
begin //general attachment
pnlAttachments.visible := true;
li := lvMessageParts.Items.Add;
li.ImageIndex := 8;
li.Caption :=
TIdAttachment(Msg.MessageParts.Items[intIndex]).Filename;
li.SubItems.Add(TIdAttachment(Msg.MessageParts.Items[intIndex]).ContentType)
;
end
else
begin //body text
if Msg.MessageParts.Items[intIndex] is TIdText then
begin
Memo1.Lines.Clear;
Memo1.Lines.AddStrings(TIdText(Msg.MessageParts.Items[intIndex]).Body);
end
end;
end;
ShowStatus(stTemp);
Showbusy(false);
end;
Memo1 is blank, empty no mail message yet here is the mail message (from
outlook message source)
Subject: Virtual folder
Date: Thu, 27 May 2004 14:55:52 -0400
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_000D_01C443FA.B4CC0110"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
This is a multi-part message in MIME format.
------=_NextPart_000_000D_01C443FA.B4CC0110
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
Virtual folder
PkgT-4
Year Make Model Color Status Date=20
2004 Chevy Caviler White New 2004/05/17 =20
......
......
===========
The "Virtual folder....... onwards is not shown in Memo1 at all???
In fact all messages in my inbox, I can read using outlook, but using the
MailDemo
the Memo1 is blank/ empty
Thanks in advance
Barry
 

Re:Message Not Displayed

Hi Gambit
Where else could my prob be ?
I sent the code you asked for and used 9.0.14 as of
Friday?
Thanks
Barry
 

Re:Message Not Displayed

Is there any further advice?
Should I try Indy 10 even though it is beta, or stick with 9.0.14?
Would like to be able to read my mail ???
Thanks in advance
Barry
"Barry Fawthrop" <XXXX@XXXXX.COM>writes
Quote
Thanks

I reInstalled 9.0.14 from today and it still fails

Here is the section called from the demo source

procedure TfrmMain.RetrieveExecute(Sender: TObject);
var
stTemp: string;
intIndex: Integer;
li: TListItem;
begin
stTemp := Statusbar1.Panels[1].text;
if lvHeaders.Selected = nil then
begin
Exit;
end;
//initialise
Showbusy(true);
Msg.Clear;
Memo1.Clear;
lvMessageParts.Items.Clear;
From.Caption := '';
Cc.Caption := '';
Subject.Caption := '';
Date.Caption := '';
Receipt.Caption := '';
Organization.Caption := '';
Priority.Caption := '';
pnlAttachments.visible := false;

//get message and put into MSG
ShowStatus('Retrieving message "' +
lvHeaders.Selected.SubItems.Strings[2] + '"');
POP.Retrieve(lvHeaders.Selected.Index + 1, Msg);
statusbar1.Panels[0].text := lvHeaders.Selected.SubItems.Strings[2];

//Setup fields on screen from MSG
From.Caption := Msg.From.Text;
Recipients.Caption := Msg.Recipients.EmailAddresses;
Cc.Caption := Msg.CCList.EMailAddresses;
Subject.Caption := Msg.Subject;
Date.Caption := FormatDateTime('dd mmm yyyy hh:mm:ss', Msg.Date);
Receipt.Caption := Msg.ReceiptRecipient.Text;
Organization.Caption := Msg.Organization;
Priority.Caption := IntToStr(Ord(Msg.Priority) + 1);

//Setup attachments list
ShowStatus('Decoding attachments (' + IntToStr(Msg.MessageParts.Count)
+
')');
for intIndex := 0 to Pred(Msg.MessageParts.Count) do
begin
if (Msg.MessageParts.Items[intIndex] is TIdAttachment) then
begin //general attachment
pnlAttachments.visible := true;
li := lvMessageParts.Items.Add;
li.ImageIndex := 8;
li.Caption :=
TIdAttachment(Msg.MessageParts.Items[intIndex]).Filename;


li.SubItems.Add(TIdAttachment(Msg.MessageParts.Items[intIndex]).ContentType)
;
end
else
begin //body text
if Msg.MessageParts.Items[intIndex] is TIdText then
begin
Memo1.Lines.Clear;

Memo1.Lines.AddStrings(TIdText(Msg.MessageParts.Items[intIndex]).Body);
end
end;
end;
ShowStatus(stTemp);
Showbusy(false);
end;

Memo1 is blank, empty no mail message yet here is the mail message (from
outlook message source)

Subject: Virtual folder
Date: Thu, 27 May 2004 14:55:52 -0400
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_000D_01C443FA.B4CC0110"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409

This is a multi-part message in MIME format.

------=_NextPart_000_000D_01C443FA.B4CC0110
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

Virtual folder
PkgT-4


Year Make Model Color Status Date=20
2004 Chevy Caviler White New 2004/05/17 =20
......
......
===========
The "Virtual folder....... onwards is not shown in Memo1 at all???
In fact all messages in my inbox, I can read using outlook, but using the
MailDemo
the Memo1 is blank/ empty

Thanks in advance
Barry


 

Re:Message Not Displayed

What happens here when you run it through, does it go into the TIdText bit?
<snip>
Quote
>for intIndex := 0 to Pred(Msg.MessageParts.Count) do
>begin
>if (Msg.MessageParts.Items[intIndex] is TIdAttachment) then
>begin //general attachment
>pnlAttachments.visible := true;
>li := lvMessageParts.Items.Add;
>li.ImageIndex := 8;
>li.Caption :=
>TIdAttachment(Msg.MessageParts.Items[intIndex]).Filename;
>
>

li.SubItems.Add(TIdAttachment(Msg.MessageParts.Items[intIndex]).ContentType)

>;
>end
>else
>begin //body text
>if Msg.MessageParts.Items[intIndex] is TIdText then
>begin
>Memo1.Lines.Clear;
>
>Memo1.Lines.AddStrings(TIdText(Msg.MessageParts.Items[intIndex]).Body);
>end
>end;
>end;
>ShowStatus(stTemp);
>Showbusy(false);
>end;
>
>Memo1 is blank, empty no mail message yet here is the mail message (from
>outlook message source)
>
>Subject: Virtual folder
>Date: Thu, 27 May 2004 14:55:52 -0400
>MIME-Version: 1.0
>Content-Type: multipart/alternative;
>boundary="----=_NextPart_000_000D_01C443FA.B4CC0110"
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Mailer: Microsoft Outlook Express 6.00.2800.1409
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
>
>This is a multi-part message in MIME format.
>
>------=_NextPart_000_000D_01C443FA.B4CC0110
>Content-Type: text/plain;
>charset="Windows-1252"
>Content-Transfer-Encoding: quoted-printable
>
>Virtual folder
>PkgT-4
>
>
>Year Make Model Color Status Date=20
>2004 Chevy Caviler White New 2004/05/17 =20
>......
>......
>===========
>The "Virtual folder....... onwards is not shown in Memo1 at all???
>In fact all messages in my inbox, I can read using outlook, but using the
>MailDemo
>the Memo1 is blank/ empty
>
>Thanks in advance
>Barry
>
>



 

Re:Message Not Displayed

Thanks Gavin
Using the same code just adding ShowMessages in
ShowMessage ('Test 1');
for intIndex := 0 to Pred(Msg.MessageParts.Count) do
begin
ShowMessage ('Test 2');
if (Msg.MessageParts.Items[intIndex] is TIdAttachment) then
begin //general attachment
ShowMessage ('Test 3');
pnlAttachments.visible := true;
li := lvMessageParts.Items.Add;
li.ImageIndex := 8;
li.Caption :=
TIdAttachment(Msg.MessageParts.Items[intIndex]).Filename;
li.SubItems.Add(TIdAttachment(Msg.MessageParts.Items[intIndex]).ContentType)
;
ShowMessage ('Test 4');
end
else
begin //body text
ShowMessage ('Test 5');
if Msg.MessageParts.Items[intIndex] is TIdText then
begin
ShowMessage ('Test 6');
Memo1.Lines.Clear;
Memo1.Lines.AddStrings(TIdText(Msg.MessageParts.Items[intIndex]).Body);
ShowMessage ('Test 7');
end
end;
ShowMessage ('Test 9');
end;
ShowMessage ('Test 10');
ShowStatus(stTemp);
Showbusy(false);
When You run you get
1 , 2 , 5 , 6 , 7 , 9
2 , 5 , 6 , 7 , 8 , 10
So Yes TIdText is activated (Twice)
Thanks in advance
Barry
 

Re:Message Not Displayed

Looks like its going wrong here. Is there any data in .Body?
Quote
Memo1.Lines.AddStrings(TIdText(Msg.MessageParts.Items[intIndex]).Body);
 

Re:Message Not Displayed

ShowMessage ('Test 6');
Memo1.Lines.Clear;
Memo1.Lines.AddStrings(TIdText(Msg.MessageParts.Items[intIndex]).Body);
ShowMessage(Msg.MessageParts.Items[intIndex].GetNamePath);
ShowMessage(Msg.MessageParts.Items[intIndex].ContentTransfer);
ShowMessage(Msg.MessageParts.Items[intIndex].ContentType);
ShowMessage(TIdText(Msg.MessageParts.Items[intIndex]).ExtraHeaders.Text);
ShowMessage(IntToStr(TIdText(Msg.MessageParts.Items[intIndex]).Body.Count));
ShowMessage ('Test 7');
Adding these showMessage
You get
First run through
6
TIdMessageParts[0]
quoted-printable
text/plain; charset="Windows-1252"
{blank}
0
7
Second run through
6
TIdMessageParts[1]
quoted-printable
text/html; charset="Windows-1252"
{blank}
0
7
Where else can I check I really do appreicate your help Thank You
Barry
 

Re:Message Not Displayed

Judging from this it looks like nothing is betting put into .body or the
typecasting isn't working.
Quote
ShowMessage(IntToStr(TIdText(Msg.MessageParts.Items[intIndex]).Body.Count));

0
 

Re:Message Not Displayed

Hi Gavin
I tend to agree with you, But where do I check for those two issues ?
Thanks
Barry
"Gavin Watkinson" <XXXX@XXXXX.COM>writes
Quote
Judging from this it looks like nothing is betting put into .body or the
typecasting isn't working.

>
ShowMessage(IntToStr(TIdText(Msg.MessageParts.Items[intIndex]).Body.Count));
>
>0