;end;
next;
end;
first;
DBGrid1.DataSource.DataSet.EnableControls;
end;
NMSMTP1.PostMessage.FromAddress:=EditAddress.Text;
NMSMTP1.PostMessage.FromName:=EditName.Text;
NMSMTP1.PostMessage.Subject:=EditSubject.Text;
NMSMTP1.PostMessage.ToAddress.Text:=Memo1.Text;
//NMSMTP1.PostMessage.ToAddress.AddStrings(ts_To);
//NMSMTP1.PostMessage.ToAddress.Text:=s_To;
//NMSMTP1.PostMessage.ToAddress.Add(Editto.Text);
//NMSMTP1.PostMessage.ToBlindCarbonCopy.AddString(ts_BCC.Text);
//NMSMTP1.PostMessage.ToBlindCarbonCopy.Add(EditBCC.Text);
//NMSMTP1.PostMessage.ToCarbonCopy.AddStrings(ts_CC);
//NMSMTP1.PostMessage.ToCarbonCopy.Add(EditCC.Text);
NMSMTP1.PostMessage.Attachments.AddStrings(ListBoxAttachments.Items);
NMSMTP1.PostMessage.Body.Text:=MemoMail.Text;
//NMSMTP1.PostMessage.Body.Assign(MemoMail.Lines);
//NMSMTP1.PostMessage.Body.AddStrings(MemoMail.Lines);
NMSMTP1.SendMail;
ShowMessage(''邮件发送完毕!#1'');//}
end;
procedure TFSMTP.NMSMTP1EncodeStart(Filename: String);
begin
StatusBar1.SimpleText:=''Encoding''+Filename;
end;
procedure TFSMTP.NMSMTP1EncodeEnd(Filename: String);
begin
StatusBar1.SimpleText:=''Finished Encoding''+Filename;
end;
procedure TFSMTP.NMSMTP1ConnectionFailed(Sender: TObject);
begin
ShowMessage(''连接失败'');
end;
procedure TFSMTP.NMSMTP1ConnectionRequired(var Handled: Boolean);
begin
if MessageDlg(''Connection Required Connect ?'',
mtConfirmation,mbOkCancel,0)=mrOk then begin
Handled:=TRUE;
NMSMTP1.Connect;
end;
end;
procedure TFSMTP.NMSMTP1Failure(Sender: TObject);
begin
StatusBar1.SimpleText:=''错误'';
end;
procedure TFSMTP.NMSMTP1HostResolved(Sender: TComponent);
begin
StatusBar1.SimpleText:=''Host Resolved'';
end;
procedure TFSMTP.NMSMTP1InvalidHost(var Handled: Boolean);
var TmpStr:String;
begin
if inputquery(''Invalid Host!'',''Specify a new host:'',TmpStr) then
begin
NMSMTP1.Host:=TmpStr;
Handled:=True;
end;
end;
procedure TFSMTP.NMSMTP1PacketSent(Sender: TObject);
begin
StatusBar1.SimpleText:=IntToStr(NMSMTP1.BytesSent)
+''bytes of''+IntToStr(NMSMTP1.BytesTotal)+''sent'';
end;
procedure TFSMTP.NMSMTP1RecipientNotFound(Recipient: String);
begin
ShowMessage(''Recipient''+''''''''+Recipient+''''''''+''not found'');
end;
procedure TFSMTP.NMSMTP1SendStart(Sender: TObject);
begin
StatusBar1.SimpleText:=''发送邮件'';
end;
procedure TFSMTP.NMSMTP1Success(Sender: TObject);
begin
StatusBar1.SimpleText:=''成功'';
end;
procedure TFSMTP.NMSMTP1HeaderIncomplete(var handled: Boolean;
hiType: Integer);
begin
ShowMessage(''Header Incomplete.'');
end;
procedure TFSMTP.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
NMSMTP1.Abort;
end;
procedure TFSMTP.ButtonConnection2Click(Sender: TObject);
begin
if ButtonConnection2.Caption=''连接'' then begin
NMSMTP1.Host:=EditHost.Text;
NMSMTP1.Port:=StrToInt(EditPort.Text);
&n