解决方案 »
- delphi调用vc++的TLB文件
- 一段感想,一段思考,希望大家一起讨论一下,能给我一些引导
- 问一下,Delphi中的VCL组件究竟是如何显示出来,是windows有图形化的功能还是,用了Windows系统给DelphiWinAPI
- 请教一个ADOquery 的问题。郁闷死了:(
- 如果查表,acess ,ado 急
- D区域【斑竹】请问:我的可用这几天怎么都没增加?
- 在delphi中调用C++ DLL文件,程序不能运行,请见源码,特急!!!!!在线等!!!
- 急问,关于类的用法!!!!
- 建议:兄弟们觉不觉得点过的贴子没点过的贴子的颜色差别太小,能不能改改
- 100分求教fastreport报表问题
- 用indy10收取邮件的问题
- IDFTP.Get 这个函数 如果文件正在下载中``怎么终止?
www.2ccc.com 养成自己动手的好习惯
我做过的,比较简单。
比如解码等,我还没找到一个可以解我现有邮箱中所有错码的算法。
还有就是接收邮件时有什么方法可以不下载邮件整体,只下载指定的部分如标题等
我现在发现就算我只指定标题,他一样把附件也下载了,这样速度太慢还有就是现在发163.com时总是提示命令次序错误为什么我肯定不是什么也没做就上来发贴子的谢谢
function Tfrm_accept_mail.CheckTxt(s:string): string;
var
s1, s2, s3: integer;
t, v: string;
Encoding: char;
hex, step: integer;
a1: array[1..4] of byte;
b1: array[1..3] of byte;
j: integer;
byte_ptr, real_bytes: integer;
begin
s1 := Pos('=?', s);
s2 := 1;
hex := 0;
if s1 > 0 then
begin
for s2 := Length(s) - 1 downto 1 do
begin
if Copy(s, s2, 2) = '?=' then Break;
end;
end;
if (s1 = 0) or (s2 = 1) then
begin
Result := s;
Exit;
end;
t := Copy(s, s1 + 2, s2 - 2 - s1);
s3 := Pos('?', t);
Delete(t, 1, s3);
if (t = '') then
begin
Result := s;
Exit;
end;
Encoding := t[1];
Delete(t, 1, 2);
v := '';
step := 0;
case Encoding of
'Q':
while t <> '' do
begin
case step of
0:
begin
case t[1] of
'_': v := v + ' ';
'=': step := 1;
else
v := v + t[1];
end;
end;
1:
begin
if t[1] <= '9' then
hex := (Ord(t[1]) - Ord('0')) * 16
else
hex := (Ord(t[1]) - 55) * 16;
step := 2;
end;
2:
begin
if t[1] <= '9' then
hex := hex + (Ord(t[1]) - Ord('0'))
else
hex := hex + Ord(t[1]) - 55;
v := v + Chr(hex);
step := 0;
end;
end;
Delete(t, 1, 1);
end;
'B':
begin
byte_ptr := 0;
for j := 1 to Length(t) do
begin
Inc(byte_ptr);
case t[j] of
'A'..'Z': a1[byte_ptr] := Ord(t[j]) - 65;
'a'..'z': a1[byte_ptr] := Ord(t[j]) - 71;
'0'..'9': a1[byte_ptr] := Ord(t[j]) + 4;
'+': a1[byte_ptr] := 62;
'/': a1[byte_ptr] := 63;
'=': a1[byte_ptr] := 64;
end;
if byte_ptr = 4 then
begin
byte_ptr := 0;
real_bytes := 3;
if a1[1] = 64 then real_bytes := 0;
if a1[3] = 64 then
begin
a1[3] := 0;
a1[4] := 0;
real_bytes := 1;
end;
if a1[4] = 64 then
begin
a1[4] := 0;
real_bytes := 2;
end;
b1[1] := a1[1] * 4 + (a1[2] div 16);
b1[2] := (a1[2] mod 16) * 16 + (a1[3] div 4);
b1[3] := (a1[3] mod 4) * 64 + a1[4];
if (real_bytes > 0) then
v := v + chr(b1[1]);
if (real_bytes > 1) then
v := v + chr(b1[2]);
if (real_bytes > 2) then
v := v + chr(b1[3]);
end;
end;
end;
end;
Result := Copy(s, 1, s1 - 1) + v + Copy(s, s2 + 2, 999);
end;
答:请用IdPOP31.RetrieveHeader(MessageNum,Msg);这样正文和附件不会读取,速度快 不过在此我想请问楼主,我也在做邮件收发程序,我现在不知道怎么样把邮件正文和附件直接收到后就保存在数据库或者在本地,请指教。