X
xebaobei
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);
Var
Body:TStringList;
begin
Body:=TStringList.Create;
Body.Add('发达式');
IdMessage1.Body.Assign(Body);
IdMessage1.From.Text := 'szq993@163.com';
IdMessage1.Recipients.EMailAddresses := 'szq993@163.com';
IdMessage1.Subject := '123456';
IdSMTP1.UserID :='szq993';
IdSMTP1.Password:='8813378';
//如果smtp没有校验用户,可以不用以上两句
IdSMTP1.Host := 'smtp.163.com';
IdSMTP1.Connect;
try
IdSMTP1.Send(IdMessage1);
finally
IdSMTP1.Disconnect;
end;
end;
Var
Body:TStringList;
begin
Body:=TStringList.Create;
Body.Add('发达式');
IdMessage1.Body.Assign(Body);
IdMessage1.From.Text := 'szq993@163.com';
IdMessage1.Recipients.EMailAddresses := 'szq993@163.com';
IdMessage1.Subject := '123456';
IdSMTP1.UserID :='szq993';
IdSMTP1.Password:='8813378';
//如果smtp没有校验用户,可以不用以上两句
IdSMTP1.Host := 'smtp.163.com';
IdSMTP1.Connect;
try
IdSMTP1.Send(IdMessage1);
finally
IdSMTP1.Disconnect;
end;
end;