Sending mail messages from a database via SMTP

 
clSmtp1.UserName := 'user';   
clSmtp1.Password := 'passw';   
clSmtp1.Open();   
 
DataSet1.First();   
 
while not DataSet1.Eof do   
begin   
   clSmtp1.MailFrom := DataSet1.FieldByName('message_from').AsString;   
   clSmtp1.MailToList.Text := DataSet1.FieldByName('message_to').AsString;   
   clSmtp1.MailData.Text := memoField.AsString;   
   clSmtp1.Send();   
   DataSet1.Next();   
end;   
clSmtp1.Close();  

Add Feedback