Send email after insert but only if Field1= Yes

Hi! How can I send an email to a user after insert, but only be sent if the field1=Yes? If its not equal Yes on insert, then don’t sent anything

OnAfterInsert event:

if({Field1} == "Yes")
{
    // Your code to send email here
}

Hi, this is a very good topic.
Could you please share some code examples on sending mail with if ?