当前位置:主页>销售管理软件> 列表

delphi邮件收发

销售管理软件版1楼: 各位大侠 , 能不能帮我弄点 邮件收发的资料啊,或是一些代码。
感激 感激

2楼: 果看 IndyDemos
里面有例子…… 如永久免费的记账软件

3楼: 下载地址:
http://www.indyproject.org/indy/demodownloads/I9D6_Demos_24Nov02.zip

4楼: 我写了一个发邮件的函数,包你满意
type
TLoginEmailServer=record
SMTPHost:string;
SMTPPort:integer;
Username:string;
Password:string;
SmtpAuthType:integer;
end;
function SendEmail(poSMTPServer:TLoginEmailServer;poBody:Tstrings;psFromEmial,
psToEmail,psSubject:string;psContentType:string;
CCToEmail:string;poAttachmentPath:TStrings):integer;
var
loIdMsgSend: TIdMessage;
loSMTP: TIdSMTP;
i:integer;
begin
Result:=3;
loIdMsgSend:=nil;
loSMTP:=nil;
try
loIdMsgSend:=TIdMessage.Create(nil);
loSMTP:=TIdSMTP.Create(nil);
with loIdMsgSend do
begin
ContentType:=psContentType;
From.Text := psFromEmial;
ReplyTo.EMailAddresses := psFromEmial;
Recipients.EMailAddresses := psToEmail;
CCList.EMailAddresses:=CCToEmail;
Subject := psSubject;
Priority := mpHigh;
ReceiptRecipient.Text := '''';
Body.Assign(poBody);
if Assigned(poAttachmentPath) then
begin
for i := 0 to poAttachmentPath.Count-1 do
begin
TIdAttachment.Creat(loIdMsgSend.MessageParts,poAttachmentPath.Strings[i]);
end;
end;
end;
with loSMTP do
begin
Host :=poSMTPServer.SMTPHost;
Port := poSMTPServer.SMTPPort;
if poSMTPServer.SmtpAuthType=1 then
AuthenticationType:=atLogin
else
AuthenticationType:=atNone;
Username := poSMTPServer.Username;
Password := poSMTPServer.Password;
try
Connect;
Send(loIdMsgSend);
except
result:=2;
exit;
end;
Result:=0;
finally
loIdMsgSend.Free;
loSMTP.Free;
end;
end;

5楼: 感谢各位,能不能在多点啊!!

6楼: 这已写的很详细了,你只要调用这个函数,把要传的参数传进来就行了。

销售管理软件版7楼: 多人接受答案了。