哪位有没有本地邮箱收发程序的源码或例子,类似于FOXMAIL或OUTLOOK,谢谢~
解决方案 »
- delphi 达人~~ 请问 delphi 能用 c++的 lib 库不???????
- 广交做数据库的DELPHI朋友,留下QQ号或MSN的都有分。
- 请教:是不是机器上必须安装BDE,才能运行delphi编译的数据库程序(dbase)?能不能在用InstallShield Express制作安装程序时,将BDE包含进去
- to:alphax(???),为了表示感谢,请再进来领点分吧!
- 我朋友的同事(美女)歌唱比赛,来UP一下呀,还有可能获奖哦~~~~
- 如何判断子窗口是否已经被创建
- 回答者有分!!!
- 请问谁有Diablo II 的硬盘版?
- 小问题一个,麻烦了
- 关于程序启动时增加登录窗口的问题
- delphi 调用webservice 的问题
- 开发思路,请教大家!
function TWagerList.SendMail(FromAddr, MyPassword, ToAddr,AttachmentPath,SubjectName:string): boolean;
var
FileName : String;
msg_send : TIdMessage;
IdSMTP : TIdSMTP ;
begin
Try
Result := False;
msg_send := TIdMessage.Create(nil);
IdSMTP := TIdSMTP.Create(nil);
FileName := AttachmentPath;
if not FileExists(FileName) then
exit; //封装邮件体
msg_send.Sender.Address := FromAddr;
msg_send.From.Text := FromAddr; //设置收件人
msg_send.Recipients.Add;
msg_send.Recipients.Items[0].Address := ToAddr;
msg_send.Recipients.Add;
msg_send.Recipients.Items[1].Address := FromAddr;
msg_send.Subject := SubjectName; //添加附件
TIdAttachment.Create(msg_send.MessageParts, FileName); //连接服务器,发送邮件
with IdSMTP do
begin
Host := 'mail.163.net';
Port := 25;
AuthenticationType := atLogin;
UserName := FromAddr;
PassWord := MyPassword;
try
Connect;
Send(msg_send);
//deletefile(FileName);
Disconnect;
Result := True;
except
//Application.MessageBox(pchar('上传数据不成功,可能是网络无法连接远程服务器'), '上传数据', MB_OK + MB_ICONQUESTION);
Result := False;
Disconnect;
end;
//Application.MessageBox(pchar('上传数据成功.'), '上传数据', MB_OK + MB_ICONINFORMATION);
end;
Finally
msg_send.Free;
IdSMTP.Free;
end;end;
EMail idMSTP TMail200 idPOP3 xml
EMail 收发系统
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, IdMessage, IdBaseComponent, IdComponent,DateUtils,
IdTCPConnection, IdTCPClient, IdMessageClient, IdSMTP;type
TForm1 = class(TForm)
IdSMTP1: TIdSMTP;
IdMessage1: TIdMessage;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
begin
try
IdSMTP1.Host:='172.20.100.21';
IdSMTP1.Username:='jufei';
IdSMTP1.Password:='1234';
IdSMTP1.Port:=25;
IdSMTP1.AuthenticationType:=atLogin;
IdSMTP1.Connect;
IdMessage1.Recipients.EMailAddresses:='[email protected]';
IdMessage1.From.Address:='[email protected]';
IdMessage1.Subject:='Love mail';
IdMessage1.Body.Text:='Dear Wife,'+#13#10+' If you receive this Email,That is what I miss you......'+#13+#13+'Success_ju'+#13+formatdatetime('yyyy/mm/dd',Now);
IdSMTP1.Authenticate;
IdSMTP1.Send(IdMessage1);
ShowMessage('@_@發送成功!');
IdSMTP1.Disconnect;
except
IdSMTP1.Disconnect;
Showmessage('@^^@發送失敗!');
Exit;
end;
end;end.
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, IdMessage, IdBaseComponent, IdComponent,DateUtils,
IdTCPConnection, IdTCPClient, IdMessageClient, IdSMTP;type
TForm1 = class(TForm)
IdSMTP1: TIdSMTP;
IdMessage1: TIdMessage;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
begin
try
IdSMTP1.Host:='172.20.100.21';
IdSMTP1.Username:='jufei';
IdSMTP1.Password:='1234';
IdSMTP1.Port:=25;
IdSMTP1.AuthenticationType:=atLogin;
IdSMTP1.Connect;
IdMessage1.Recipients.EMailAddresses:='[email protected]';
IdMessage1.From.Address:='[email protected]';
IdMessage1.Subject:='Love mail';
IdMessage1.Body.Text:='Dear Wife,'+#13#10+' If you receive this Email,That is what I miss you......'+#13+#13+'Success_ju'+#13+formatdatetime('yyyy/mm/dd',Now);
IdSMTP1.Authenticate;
IdSMTP1.Send(IdMessage1);
ShowMessage('@_@發送成功!');
IdSMTP1.Disconnect;
except
IdSMTP1.Disconnect;
Showmessage('@^^@發送失敗!');
Exit;
end;
end;end.