Sendmail Feature Different in Forms from Functions

Sendmail Feature Different in Forms from Functions

Why is the SENDMAIL feature different in FORMS then in FUNCTIONS?

Example, you can not attached or include a Template when using SENDMAIL in a Function.

What I'm trying to do is include the Custom Record Summary with a function request.  This function request I need the template included is used during a Custom Action definition.

I tried cuting and pasting from the SENDMAIL in FORMS, but it gives me an error.  What I'm trying to do is include a custom record summary as a PDF attachment to be used by a custom action button on a menu.

Here are the two exmaples:
SENDMAIL from FORMS
sendmail
[
from:zoho.loginuserid
to:input.Email_PDF
cc:" xxx@xxx.org"
subject:input.Inspection_Name_Business + " Inspection Report"
message:"Attached please find a copy of the Inspection Form for " 
content type:HTML
attachments :template:Inspection_Report2 as PDF,template:Invoice1 as PDF
]

SENDMAIL from FUNCTONS
void email.Sendmail(Inspection toaddress)
{
    sendmail
    (
        To       :  toaddress.Email_PDF 
        From     :  zoho.adminuserid 
        Subject  :  "Invoice for " + toaddress.Inspection_Name_Business 
        Message  :  "Attached is a copy of the Invoice for a Inspection conducted on " + toaddress.DATE_field + " for " + toaddress.Inspection_Name_Business 
    )
}