J
jingtao
Unregistered / Unconfirmed
GUEST, unregistred user!
D6
procedure TForm1.Button1Click(Sender: TObject);
begin
if IdSMTP1.Connected then IdSMTP1.Disconnect;
IdSMTP1.Host:='smtp.21cn.com';
IdSMTP1.UserId:='lovejingtao';
IdSMTP1.Password:='***********************';
IdSMTP1.AuthenticationType:=atLogin;
try
IdSMTP1.Connect;
except
Showmessage('Connect Error');
Exit;
end;
IdMessage1.Body.Clear;
IdMessage1.Body.Add('test');
IdMessage1.From.Text:='lovejingtao@21cn.com';
IdMessage1.Recipients.EMailAddresses:='lovejingtao@21cn.com';//收件人
IdMessage1.Subject:='主题';
try
IdSMTP1.Send(IdMessage1);
finally
IdSMTP1.Disconnect;
Showmessage('ok');
end;
下面方法已经试验过.
找到IDMessage.pas,再其中搜索Values['X-Library'] ,把它所在的行注释掉,就可以了
然后保存,重新编译控件包,或者重新安装控件,要么把这个单元加入工程也可以
没有任何邮件......
procedure TForm1.Button1Click(Sender: TObject);
begin
if IdSMTP1.Connected then IdSMTP1.Disconnect;
IdSMTP1.Host:='smtp.21cn.com';
IdSMTP1.UserId:='lovejingtao';
IdSMTP1.Password:='***********************';
IdSMTP1.AuthenticationType:=atLogin;
try
IdSMTP1.Connect;
except
Showmessage('Connect Error');
Exit;
end;
IdMessage1.Body.Clear;
IdMessage1.Body.Add('test');
IdMessage1.From.Text:='lovejingtao@21cn.com';
IdMessage1.Recipients.EMailAddresses:='lovejingtao@21cn.com';//收件人
IdMessage1.Subject:='主题';
try
IdSMTP1.Send(IdMessage1);
finally
IdSMTP1.Disconnect;
Showmessage('ok');
end;
下面方法已经试验过.
找到IDMessage.pas,再其中搜索Values['X-Library'] ,把它所在的行注释掉,就可以了
然后保存,重新编译控件包,或者重新安装控件,要么把这个单元加入工程也可以
没有任何邮件......