• PUDN用户
    了解作者
  • C++ Builder
    开发工具
  • 1.1MB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 115
    下载次数
  • 2005-09-07 16:24
    上传日期
邮件的发送与接收程序,经典功能完善。包含可执行程序及完整的源代码!
邮件接收和发送20050908.rar
  • chapter3(邮件接收和发送系统)
  • Image
  • previous.bmp
    1KB
  • 1111.bmp
    374B
  • 2.bmp
    374B
  • EMAILin.bmp
    766B
  • 1.bmp
    374B
  • EMAIL.bmp
    766B
  • delete.bmp
    1.7KB
  • next.bmp
    1KB
  • forward.bmp
    2KB
  • reply.bmp
    2KB
  • EMAILout.bmp
    766B
  • 3.bmp
    374B
  • MainForm.cpp
    11.6KB
  • Mail.exe
    68KB
  • MainForm.h
    3.1KB
  • 模板-_3.dot
    22.5KB
  • SendForm.ddp
    51B
  • 模板-_1.dot
    22.5KB
  • MainForm.dfm
    19.7KB
  • Mail.bpr
    3.9KB
  • SendForm.obj
    611.3KB
  • SendForm.cpp
    7KB
  • MainForm.ddp
    51B
  • Mail.cpp
    881B
  • Mail.obj
    411.5KB
  • SendForm.h
    2.9KB
  • SettingForm.h
    1.5KB
  • Temp3.mme
    143.5KB
  • Temp11.mme
    143.5KB
  • SettingForm.dfm
    6.2KB
  • SettingForm.ddp
    51B
  • MainForm.obj
    701.2KB
  • Temp9.mme
    30.8KB
  • 模板-_2.dot
    22.5KB
  • 模板-_4.dot
    22.5KB
  • SendForm.dfm
    7.7KB
  • Unit1.obj
    404.8KB
  • Mail.res
    876B
  • Mail.tds
    896KB
  • Temp2.mme
    138.2KB
  • 模板-.dot
    22.5KB
  • Temp1.mme
    138.2KB
  • Temp10.mme
    30.8KB
  • SettingForm.cpp
    1.3KB
  • SettingForm.obj
    626KB
  • 模板-_5.dot
    22.5KB
  • www.pudn.com.txt
    218B
内容介绍
//--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include "MainForm.h" #include "SettingForm.h" #include "SendForm.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TMainForm *MainForm; //--------------------------------------------------------------------------- void __fastcall TMainForm::GetMail(int i) { MainForm->NMPOP31->GetMailMessage(i); MainForm->txtBody->Lines->Assign(MainForm->NMPOP31->MailMessage->Body); } //--------------------------------------------------------------------------- __fastcall TMainForm::TMainForm(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TMainForm::mnuSettingClick(TObject *Sender) { SettingForm->ShowModal(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::mnuExitClick(TObject *Sender) { Close() ; } //--------------------------------------------------------------------------- int TMainForm::FindRealtMailNo(int i) { int j; for(j=i;j<MailList.Length;j++) if (MailList[j]==1) return j; for(j=1;j<i;j++) if (MailList[j]==1) return j; return 0; } //--------------------------------------------------------------------------- void __fastcall TMainForm::mnuDeleteMailClick(TObject *Sender) { int i,nextmail; i = lstmail->Selected->Index+1; //从本程序邮件列表删除邮件信息 lstmail->Selected->Delete(); // 在服务器邮件列表中对给定邮件打上删除标记 NMPOP31->DeleteMailMessage(FindRealtMailNo(i)); //设置邮件删除标记 MailList[FindRealtMailNo(i)]=0; //剩余邮件总数 MailLeft--; //刷新邮件内容 if (MailLeft > 0) { txtBody->Lines->Clear(); nextmail=FindRealtMailNo(i); GetMail(nextmail) ; StatusBar1->SimpleText = "# of E-Mail: " + IntToStr(nextmail) ; } else { //无剩余邮件,设置相关参数 txtBody->Lines->Clear(); SPeedButton3->Enabled = false ; SPeedButton4->Enabled = false ; SPeedButton5->Enabled = false ; mnuReply->Enabled = false ; mnuDelete->Enabled = false ; mnuForward->Enabled = false ; lstmail->Enabled = false; StatusBar1->SimpleText = "There is no E-Mail." ; } } //--------------------------------------------------------------------------- void __fastcall TMainForm::NMPOP31Connect(TObject *Sender) { StatusBar1->SimpleText = "Status: Connect to POP3 Server " + SettingForm->txtPOP3Host->Text ; } //--------------------------------------------------------------------------- void __fastcall TMainForm::NMPOP31ConnectionFailed(TObject *Sender) { StatusBar1->SimpleText = "Status: Connection Failed to POP3 Server " + SettingForm->txtPOP3Host->Text ; } //--------------------------------------------------------------------------- void __fastcall TMainForm::NMPOP31ConnectionRequired(bool &Handled) { if (MessageDlg("Connection Required ?", mtConfirmation, TMsgDlgButtons() << mbYes << mbNo, 0) == mrYes) { Handled = true; NMPOP31->Connect() ; } } //--------------------------------------------------------------------------- void __fastcall TMainForm::NMPOP31DecodeEnd(TObject *Sender) { StatusBar1->SimpleText = "Status: End Decoding"; } //--------------------------------------------------------------------------- void __fastcall TMainForm::NMPOP31DecodeStart(AnsiString &FileName) { StatusBar1->SimpleText = "Status: Start Decoding " + FileName; } //--------------------------------------------------------------------------- void __fastcall TMainForm::NMPOP31Disconnect(TObject *Sender) { StatusBar1->SimpleText = "Status: Disconnect from POP3 Server " + SettingForm->txtPOP3Host->Text ; } //--------------------------------------------------------------------------- void __fastcall TMainForm::NMPOP31Failure(TObject *Sender) { StatusBar1->SimpleText = "Status: Failure."; } //--------------------------------------------------------------------------- void __fastcall TMainForm::NMPOP31HostResolved(TComponent *Sender) { StatusBar1->SimpleText = "Status: Host Resolved - " + SettingForm->txtPOP3Host->Text ; } //--------------------------------------------------------------------------- void __fastcall TMainForm::NMPOP31InvalidHost(bool &Handled) { AnsiString strHost ; if (InputQuery("Invalid POP3 Mail Server", "Please enter a valid POP3 Server", strHost)) { NMPOP31->Host = strHost; Handled = true; } } //--------------------------------------------------------------------------- void __fastcall TMainForm::NMPOP31Status(TComponent *Sender, AnsiString Status) { StatusBar1->SimpleText = Status; } //--------------------------------------------------------------------------- void __fastcall TMainForm::NMPOP31Success(TObject *Sender) { StatusBar1->SimpleText = "Status: POP3 Success"; } //--------------------------------------------------------------------------- void __fastcall TMainForm::mnuReplyClick(TObject *Sender) { int i; i = lstmail->Selected->Index+1; NMPOP31->GetSummary( FindRealtMailNo(i) ); SendForm->Caption="邮件回复"; SendForm->txtTo->Text = NMPOP31->Summary->From ; SendForm->txtCC->Text = ""; SendForm->txtBCC->Text = ""; SendForm->txtSubject->Text = "Re: " + NMPOP31->Summary->Subject ; SendForm->txtBody->Clear() ; SendForm->lstAttach->Clear() ; SendForm->Caption = "Reply Mail" ; SendForm->ShowModal(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::mnuForwardClick(TObject *Sender) { int i, j; i = lstmail->Selected->Index+1; NMPOP31->GetSummary( FindRealtMailNo(i) ); SendForm->Caption="邮件转发"; SendForm->txtTo->Text = "" ; SendForm->txtCC->Text = "" ; SendForm->txtBCC->Text = "" ; SendForm->txtSubject->Text = "Fw: " + NMPOP31->MailMessage->Subject ; SendForm->txtBody->Lines->Assign(NMPOP31->MailMessage->Body) ; SendForm->lstAttach->Clear() ; if (NMPOP31->MailMessage->Attachments->Text != "") { for(j = 0; j <= NMPOP31->MailMessage->Attachments->Count - 1; i++) { SendForm->lstAttach->Items->Add(NMPOP31->MailMessage->Attachments->Strings[j]); } } SendForm->Caption = "Forward Mail" ; SendForm->ShowModal() ; } //--------------------------------------------------------------------------- void __fastcall TMainForm::FormShow(TObject *Sender) { AnsiString Pop3SeverIP; AnsiString Pop3Login; AnsiString Pop3Password; AnsiString SmtpServerIP; AnsiString SmtpLogin; AnsiString DisplayName; AnsiString EmailAddress; //用户邮箱设置信息存放在HKEY_LOCAL_MACHINE下的SOFTWARE\\MyMail\\Info中 Registry=new TRegistry; Registry->RootKey=HKEY_LOCAL_MACHINE; Registry->OpenKey("SOFTWARE\\MyMail\\Info",true); //用户邮箱设置信息读入 try { Pop3SeverIP=Registry->ReadString("Pop3SeverIP"); Pop3Login=Registry->ReadString("Pop3Login"); Pop3Password=Registry->ReadString("Pop3Password"); SmtpServerIP=Registry->ReadString("SmtpServerIP");; SmtpLogin=Registry->ReadString("SmtpLogin"); DisplayName=Registry->ReadString("DisplayName"); EmailAddress=Registry->ReadString("EmailAddress"); SettingForm->txtPOP3Host->Text=Pop3SeverIP; SettingForm->txtPOP3UserID->Text=Pop3Login; SettingForm->txtPOP3Password->Text=Pop3Password; SettingForm->txtSMTPHost->Text=SmtpServerIP; SettingForm->txtSMTPUserID->Text=SmtpLogin
评论
    相关推荐
    • smtp邮件接收客户端
      这是一款专门负责邮件发送的客户端软件,基于GPL发布。支持TLS/SSL、DNS模式、IPv6、服务器端认证、多用户等特性。该软件和mpop是姊妹软件。 注: 如需要对TLS/SSL的支持,还需要安装>=GnuTLS -1.2.0或者>=OpenSSL-...
    • JAVA 电子邮件接收
      本软件旨在为电子邮件客户提供友好的操作界面和快捷的邮件发送服务,并可以接收附件 本软件面向的最终用户是中北大学计算机技术与科学学院相关的老师,接收他们专业指导和审核。本软件操作界面友好,使用者可能很快...
    • 电子邮件接收pop3
      包括文档和源代码,java写的。具有可视化窗口,工程目录下有一个.jar可执行文件。
    • vc++邮件收发器,接收邮件程序
      vc++编写的基于MFC的邮件收发器,接收邮件程序
    • pop3邮件接收
      本程序是一个可移植的(Win32/Linux)邮件接收(支持POP3协议)程序,并编写了可移 植SOCKET和POP3封装类,希望能为初学者提供一些帮助。 编译: Win32: 在VC++6.0下编译通过,并运行良好。 Linux: 在G++下编译通过,请...
    • 接收邮件实例接收邮件实例
      接收邮件实例 接收邮件实例 c# 接收邮件实例 接收邮件实例 c#
    • Vs2008邮件接收
      Visual Studio 20082008做的邮件接收网络编程程序
    • c#接收邮件 c#接收邮件
      c#接收邮件 c#接收邮件 c#接收邮件
    • pop3邮件接收
      本程序是一个可移植的(Win32/Linux)邮件接收(支持POP3协议)程序,并编写了可移 植SOCKET和POP3封装类,希望能为初学者提供一些帮助。 编译: Win32: 在VC++6.0下编译通过,并运行良好。 Linux: 在G++下编译通过,请...
    • POP3邮件接收
      网络实践课程作业,用C#写的一个简易的POP3邮件接收界面,可以实现邮件的获取