BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Please I really need an answer with an example plz

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
[ Eduardo Tavares ]
Guest





PostPosted: Thu Feb 26, 2004 3:01 am    Post subject: Please I really need an answer with an example plz Reply with quote



Untitled DocumentHi!
I am having this problem to check if there is an attachment to a email.
idMsg := TidMessage.Create(Self);
idMsg.Clear;
Mail.Retrieve(nMsg,idMsg);
X := 0;
for x := 0 to idMsg.MessageParts.Count-1 do This Line shows 0 when I am
debuging my app even if the email I am checking has an attachment.

What's the problem please?

I've been working on this problem for 2 months and I cant get it working.

Thank You


Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Thu Feb 26, 2004 3:19 am    Post subject: Re: Please I really need an answer with an example plz Reply with quote



"[ Eduardo Tavares ]" <davares (AT) earthlink (DOT) net> wrote


Quote:
I am having this problem to check if there is an attachment to a email.

You already asked this exact same question several days ago, and it was
already addressed. You have not yet provided the requested information
needed to reproduce and trace the problem. Please go re-read the previous
discussion. In particular, place pay attention to what was actually asked
of you:

"If it contains data that you expect should be in the MessageParts
instead, then you need to post that message data so that someone can trace
through it to see why it didn't make it in the MessageParts."


Gambit



Back to top
[ Eduardo Tavares ]
Guest





PostPosted: Thu Feb 26, 2004 3:33 am    Post subject: Re: Please I really need an answer with an example plz Reply with quote



"If it contains data that you expect should be in the MessageParts //I am
using MessageParts but it's always 0
instead, then you need to post that message data(which message data?The file
I am trying with?It's a regular text file with some text like "hi how are
you' its a txt file) so that someone can trace
through it to see why it didn't make it in the MessageParts."


Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Thu Feb 26, 2004 4:33 am    Post subject: Re: Please I really need an answer with an example plz Reply with quote

"[ Eduardo Tavares ]" <davares (AT) earthlink (DOT) net> wrote


Quote:
which message data?

The data for the message that you are downloading from the server via
Retrieve(). The easiest way to retreive the data is to attach a TIdLogFile
to the Intercept property of TIdPOP3 (assuming you are using POP3, that is)
and it will automatically record all of the downloaded data to a log file.
The alternative is to set the TIdMessage's NoEncode and NoDecode properties
to True and then call TidMessage.SaveToFile() after Retreive() returns.

Quote:
It's a regular text file with some text like "hi how
are you' its a txt file

If it is just a plain text file, then why do you expect it to be in the
MessageParts in the first place?


Gambit



Back to top
[ Eduardo Tavares ]
Guest





PostPosted: Thu Feb 26, 2004 8:57 pm    Post subject: Re: Please I really need an answer with an example plz Reply with quote

Quote:
If it is just a plain text file, then why do you expect it to be in the
MessageParts in the first place?

I am testing my app.Lets say you send me a file .txt and I have recorded in
my database to block all attachments with extension .txt.
I want my app to delete this email and do whatever else I want.


"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote

Quote:

"[ Eduardo Tavares ]" <davares (AT) earthlink (DOT) net> wrote in message
news:403d68f3$1 (AT) newsgroups (DOT) borland.com...

which message data?

The data for the message that you are downloading from the server via
Retrieve(). The easiest way to retreive the data is to attach a
TIdLogFile
to the Intercept property of TIdPOP3 (assuming you are using POP3, that
is)
and it will automatically record all of the downloaded data to a log file.
The alternative is to set the TIdMessage's NoEncode and NoDecode
properties
to True and then call TidMessage.SaveToFile() after Retreive() returns.

It's a regular text file with some text like "hi how
are you' its a txt file

If it is just a plain text file, then why do you expect it to be in the
MessageParts in the first place?


Gambit





Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Thu Feb 26, 2004 9:43 pm    Post subject: Re: Please I really need an answer with an example plz Reply with quote


"[ Eduardo Tavares ]" <davares (AT) earthlink (DOT) net> wrote


Quote:
I am testing my app.Lets say you send me a file .txt and I
have recorded in my database to block all attachments with
extension .txt. I want my app to delete this email and do
whatever else I want.

If you have made absolutely sure that you are using the latest Indy sources,
and that the TIdMessage.NoDecode property is set to False, and it still
doesn't work for you, then again, please provide an example of the actual
raw message data so someone can look into the problem for you. Your
descriptions are not enough to trace the problem without seeing actual data
to trace through.


Gambit



Back to top
[ Eduardo Tavares ]
Guest





PostPosted: Fri Feb 27, 2004 2:54 am    Post subject: Re: Please I really need an answer with an example plz Reply with quote

Ok!Sorry to keep bothering you but I really need it.

Here is the function I am using:

Function TForm1.CheckAtt(nMsg:Integer):Boolean;
var
i, x,TotAttach: Integer;
idMsg: TidMessage;
Ext,FileName,FName : String;
begin
AttDel := '';
WhiteList.Open;
Pode := False;
FName := '';
idMsg := TidMessage.Create(Self);
idMsg.Clear;
Mail.Retrieve(nMsg,idMsg);
for x := 0 to idMsg.MessageParts.Count -1 do
begin
if idMsg.MessageParts.Items[x] is TidAttachment then
Begin
FName := TIdAttachment(idMsg.MessageParts.Items[x]).Filename;
Ext :=
ExtractFileExt(tidAttachment(idMsg.MessageParts.Items[x]).FileName);
WhiteList.First;
While not WhiteList.Eof do
Begin
IF (WhiteList.FieldbyName('ext').asString =Ext) and
(WhiteList.FieldbyName('Email').asString = idMsg.From.Address) and
(WhiteList.FieldbyName('File').asString = FName) Then
Begin
Pode := True;
End;
WhiteList.Next;
End;
tbExtension.First;
while not tbExtension.Eof do
Begin
if (tbExtension.FieldbyName('Extension').asString = Ext) and
(tbExtension.FieldbyName('block').asBoolean = True) and (not Pode) then
Begin
Mail.Delete(nMsg);
AttDel := 'Attachments Deleted';
Attachs := Attachs + 1;
TotAttach := Repo.ReadInteger('Attachments','Attachs',0);
Repo.WriteInteger('Attachments','Attachs',TotAttach + 1);
tbUser.Append;
tbUser.FieldbyName('UsrEmail').asString :=idMsg.From.Address;
tbUser.FieldbyName('File').asString := FName;
tbUser.FieldbyName('Ext').asString := Ext;
tbUser.FieldbyName('Received').asString := DateToStr(Date);
tbUser.FieldbyName('Respond').asBoolean := False;
tbUser.Post;
Smtp.Host := MailServer;
Smtp.UserID := UsrID;
Smtp.PostMessage.FromAddress := 'davares (AT) earthlink (DOT) net';
Smtp.PostMessage.FromName := 'Eduardo Tavares';
Smtp.PostMessage.ToAddress.Clear;
Smtp.PostMessage.ToAddress.Add(idMsg.From.Address);
Smtp.PostMessage.Subject := 'Your email was reject by Eduardo
Tavares';
Smtp.PostMessage.Body.Clear;
Smtp.PostMessage.Body.Add(pgEmail.Content);
Smtp.Connect;
Try
Smtp.SendMail;
Finally
Smtp.Disconnect;
End;
with Smtp do
Begin
Host := '';
PostMessage.FromAddress := '';
PostMessage.FromName := '';
PostMessage.Subject := '';
PostMessage.ToAddress.Clear;
PostMessage.Body.Clear;
End;

End;
tbExtension.Next;
End;
WhiteList.First;
While not WhiteList.Eof Do
Begin
IF (Ext =WhiteList.FieldbyName('ext').asString) and
(idMsg.From.Address =WhiteList.FieldbyName('Email').asString) Then
Begin
WhiteList.Delete;
End;
WhiteList.Next;
End;
End;
end;
WhiteList.Close;
Pode := False;
idMsg.Free;
AttDel := '';
end;


And here is the content of the txt file I am sending to my self so I can
test my app.

http://www.phazeddl.com/ddl.php
http://www.electric-guitar.co.uk/
http://www.guitartricks.com/
http://www.guitaretab.com/index.php
http://www.rockmagic.net/
http://www.guitarwar.com/cgi-bin/rank/rankem.cgi?action=in&id=mrdeal
http://www.guitartabs.com/
http://www.supersonic.net/guitar/index.htm
http://magicref.tripod.com/books.htm
http://www.tabalorium.com/
http://www.ultimate-guitar.com/
http://www.e-tabs.org/news.php
http://cifraclub.terra.com.br/
http://www.cifras.com.br/
http://webforum.land.ru/wb.php?board=5994
http://tablaturas.art.br/index.htm
http://www.penguinmagic.com/
http://www.mxstudio.com.br/
http://www.area450.com/create/dvdtoaudiocd.htm
http://www.windsur-auto.com
http://java.com/en/index.jsp
http://www.suprnova.org/
http://www.pootz.org/nuke/categorias.php
http://azureus.sourceforge.net/
http://www.no-ip.com/
http://gildot.org/
http://www.appservnetwork.com/
http://www.emule-project.net/
http://sourceforge.net/forum/forum.php?forum_id=291997

It's a txt file with all of this web address and I have saved on my database
an extension .txt so I dont want to get an attachment with this extension.

Hope I have provided some information that might help you help me.
"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote

Quote:

"[ Eduardo Tavares ]" <davares (AT) earthlink (DOT) net> wrote in message
news:403e5dce$2 (AT) newsgroups (DOT) borland.com...

I am testing my app.Lets say you send me a file .txt and I
have recorded in my database to block all attachments with
extension .txt. I want my app to delete this email and do
whatever else I want.

If you have made absolutely sure that you are using the latest Indy
sources,
and that the TIdMessage.NoDecode property is set to False, and it still
doesn't work for you, then again, please provide an example of the actual
raw message data so someone can look into the problem for you. Your
descriptions are not enough to trace the problem without seeing actual
data
to trace through.


Gambit





Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Fri Feb 27, 2004 8:18 am    Post subject: Re: Please I really need an answer with an example plz Reply with quote


"[ Eduardo Tavares ]" <davares (AT) earthlink (DOT) net> wrote

Quote:
Ok!Sorry to keep bothering you but I really need it.

You have not yet provided the kind of information that is needed to help you
further on this matter. Please do so.

Quote:
And here is the content of the txt file I am sending to my
self so I can test my app.

That is *not* what was being asked for. Please re-read what was actually
asked for and how you can obtain it.


Gambit



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.