IdSMTP1: TIdSMTP;
IdMessage1: TIdMessage;
代码
IdSMTP1.Host:='smtp.163.com';
IdSMTP1.Port:=25;
IdSMTP1.Username:='发信人名称;
IdSMTP1.Password:='发信人邮箱密码';
IdSMTP1.Connect();
IdMessage1.Body.Clear;
IdMessage1.Body.Add(信的内容);
IdMessage1.From.Text:='从哪发的,应该可以邮箱欺骗';
IdMessage1.Recipients.EMailAddresses:='发到哪个邮箱';
IdMessage1.Subject:='邮件题目';
IdSMTP1.AuthenticationType := atLogin;
IdSMTP1.Authenticate;
IdSMTP1.Send(IdMessage1);
IdSMTP1.Disconnect;
end;