A
asbeforelong
Unregistered / Unconfirmed
GUEST, unregistred user!
begin
with IdMessage1 do
begin
Body.Assign(Memo1.Lines);
From.Address:=EditFromAdd.Text;
Recipients.EMailAddresses:=EditToAdd.Text;
Subject:=EditSubject.Text;
/////////程序运行的时候为什么会提示找不到文件??(填入EditAtt的文件路径肯定没错!)
TIdAttachment.Create(IdMessage1.MessageParts,EditAtt.Text);
end;
//开始发送邮件
with IdSMTP1 do
begin
Host:=EditHost.Text;
Port:=25;
Username:=EditUser.Text;
Password:=EditPSW.Text;
Connect;
try
Send(Idmessage1);
Finally
Disconnect;
end;
end;
with IdMessage1 do
begin
Body.Assign(Memo1.Lines);
From.Address:=EditFromAdd.Text;
Recipients.EMailAddresses:=EditToAdd.Text;
Subject:=EditSubject.Text;
/////////程序运行的时候为什么会提示找不到文件??(填入EditAtt的文件路径肯定没错!)
TIdAttachment.Create(IdMessage1.MessageParts,EditAtt.Text);
end;
//开始发送邮件
with IdSMTP1 do
begin
Host:=EditHost.Text;
Port:=25;
Username:=EditUser.Text;
Password:=EditPSW.Text;
Connect;
try
Send(Idmessage1);
Finally
Disconnect;
end;
end;