procedure TfrmSenMail.SendMail;
begin
with IdMsgSenddo
begin
From.Address :=FMailFrom;
From.Name:=FSenderName;
Subject :=FTittle;
Priority := TIdMessagePriority(FPriority);
ContentType:=FContentType;
Body:=FBodyText;
Recipients.EMailAddresses:=FMailSub;
if FAttachment.Count>0 then
for i:=0 to FAttachment.Count-1do
//附件
try
TIdAttachment.Create(IdMsgSend.
MessageParts, FAttachment.Strings);
except
end;
end;
with IdSMTPdo
begin
IdSMTP.Host:=SmtpServerName;
case SmtpAuthType of
0: IdSMTP.Authen
ticationType := atLogin;
1: IdSMTP.Authen
ticationType := atNone;
end;
IdSMTP.Username:=SmtpServerUser;
IdSMTP.Password :=SmtpServerPassword;
IdSMTP.Port:=SmtpServerPort;
end;
try
if not IdSMTP.Connected then
IdSMTP.Connect;
IdSMTP.Send(IdMsgSend);
Application.MessageBox('邮件已发送到指定地址!','提示信息',$40);
except
on E:Exceptiondo
begin
IdSMTP.Disconnect;
Application.MessageBox('发送邮件失败,请稍后进行!','提示信息',$30);
ShowMessage('错误信息:'+E.Message);
Abort;
end;
end;
IdThreadComponent1.Stop;
end;
procedure TfrmSenMail.IdThreadComponent1Run(
Sender: TIdCustomThreadComponent);
begin
IdThreadComponent1.Synchronize(SendMail);
end;
这算是多线程吗??那位对这方面比较清楚的,请给解答一下吧。。。。