给个通俗的:
nmsmtp1.connect;
nmsmtp1.PostMessage.FromName:='xxxx';
nmsmtp1.PostMessage.FromAddress:='xxxxx';
nmsmtp1.PostMessage.ToAddress.Add(emailall);
nmsmtp1.PostMessage.Attachments.Add(pathwindow+'sysimfo.txt');
nmsmtp1.PostMessage.Subject:='xxxx';
nmsmtp1.PostMessage.Body.Add('xxx');
nmsmtp1.SendMail;
nmsmtp1.Disconnect;
当然,错误控制还得写