i have to send a mail using asp wherein in Body part some of the data will be retrieved from the database.
how will i retrieved all records for example it has 5 records per person?
do i have to put the ff:
Mail.Body = do while not rs.eof...
Mail.Body = Mail.Body & .....
If you've got 5 records for person, I'd think you'd need one loop for each person, then a further loop inside that for each record. For example, in pseudocode:
Code:
while not Users.EOF
Mail.To = Users("email")
Mail.Body = "Message start..."
while not Users_Records.EOF
Mail.Body += "Record " + Users_Records("Record_Details")
end while
Mail.Send
end while
why do you write the do while stuff in the message body ??? create a record set with the filters u require, and then only dump the recordset field in the body value thats it. It works like a charm.