Q
qn-wl
Unregistered / Unconfirmed
GUEST, unregistred user!
以下是我的代码procedure TForm1.ButtonSendClick(Sender: TObject);
begin
screen.cursor := crHourGlass;
StatusBar1.Panels[0].Text := '请等待.....';
SakSMTP1.host := EditHost.text;
Saksmtp1.Port:='25';
SakMsg1.CharSet := 'ISO-8859-1';
SakMsg1.TextEncoding := te8Bit;
SakMsg1.UserName := EditUserName.text;
SakMsg1.From := EditFrom.text;
SakMsg1.SendTo := EditTo.text;
SakMsg1.Subject := EditSubject.text;
// memo1.Lines.Add('asasds');
SakMsg1.Text.Assign(Memo1.Lines);
SakSMTP1.connect;
if not SakSMTP1.SMTPError then
begin
BtnCancel.Enabled := true;
SakSMTP1.SendTheMessage( SakMsg1);
BtnCancel.Enabled := false;
SakSMTP1.Disconnect;
StatusBar1.Panels[0].Text := SakSMTP1.ReplyString;
end;
screen.cursor := crDefault;
end;
问题是在第一次发送后,我改了EditUserName.text后,再发第二次他还是用的第一次的用户名。请问这是为什么?
begin
screen.cursor := crHourGlass;
StatusBar1.Panels[0].Text := '请等待.....';
SakSMTP1.host := EditHost.text;
Saksmtp1.Port:='25';
SakMsg1.CharSet := 'ISO-8859-1';
SakMsg1.TextEncoding := te8Bit;
SakMsg1.UserName := EditUserName.text;
SakMsg1.From := EditFrom.text;
SakMsg1.SendTo := EditTo.text;
SakMsg1.Subject := EditSubject.text;
// memo1.Lines.Add('asasds');
SakMsg1.Text.Assign(Memo1.Lines);
SakSMTP1.connect;
if not SakSMTP1.SMTPError then
begin
BtnCancel.Enabled := true;
SakSMTP1.SendTheMessage( SakMsg1);
BtnCancel.Enabled := false;
SakSMTP1.Disconnect;
StatusBar1.Panels[0].Text := SakSMTP1.ReplyString;
end;
screen.cursor := crDefault;
end;
问题是在第一次发送后,我改了EditUserName.text后,再发第二次他还是用的第一次的用户名。请问这是为什么?