Custom Action Sendmail and set field value

Custom Action Sendmail and set field value

I have my sendmail function setup and working so that when the user selects multiple records they are emailed. However, i would also like these selected records to be marked as "emailed" so that another user does not come along and email them again. How do I accomplish this?

Here is my sendmail function if it's relevent:

  1. void sendemail2(Add_a_Container records)
    {
        msg_content = "<table border=\"0\" style=\"\" width=\"90%\" cellpadding=\"5\">\n    <tbody>\n        <tr>\n            <th align=\"left\" bgcolor=\"#bdbdbd\"><span style=\"color: rgb(255, 255, 255); font-family:Arial; font-size:11pt; \">Origin</span></th>\n     <th align=\"left\" bgcolor=\"#bdbdbd\"><span style=\"color: rgb(255, 255, 255); font-family:Arial; font-size:11pt; \">Warehouse</span></th>\n       <th align=\"left\" bgcolor=\"#bdbdbd\"><span style=\"color: rgb(255, 255, 255); font-family:Arial; font-size:11pt; \">Container Number</span></th>\n            <th align=\"left\" bgcolor=\"#bdbdbd\"><span style=\"color: rgb(255, 255, 255); font-family:Arial; font-size:11pt; \">Vessel</span></th>\n                   </tr>\n        ";
        val = "";
        for each rec in records
        {
            val = ((((((((val + "<tr>\n            <td bgcolor=\"#ededed\"><span style=\"font-family:Arial; font-size:11pt; \">") + rec.Origin) + "</span></td>\n     <td bgcolor=\"#ededed\"><span style=\"font-family:Arial; font-size:11pt; \">") + rec.Destination) + "</span></td>\n       <td bgcolor=\"#ededed\"><span style=\"font-family:Arial; font-size:11pt; \">") + rec.Container_Number) + "</span></td>\n        <td bgcolor=\"#ededed\"><span style=\"font-family:Arial; font-size:11pt; \">") + rec.Vessel) + "</span></td>\n            </tr>";
        }
        msg_content = msg_content + val + "\n    </tbody>\n</table></font>";
        sendmail
        (
            To       :  rec.Return_Email 
            From     :  zoho.loginuserid 
            CC       :  rec.CC_Email, zoho.loginuserid, zoho.adminuserid, " tburroughsmobile@gmail.com"
            Subject  :  "Containers Ready for Pick Up - LT Custom" 
            Message  :  ("The following containers are empty and ready for pick up at the listed warehosue(s).<br />\n<br />\n") + msg_content 
        )
    }