Send Email Using Apex In Salesforce

Public void SendEmailMethod(){
    Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
    String[] toAddresses = new String[] {'test1@mail.com','test2@mail.com'}; 
    String[] ccAddresses = new String[] {'testcc1@mail.com','testcc2@mail.com'};
    mail.setToAddresses(toAddresses);
    mail.setCcAddresses(ccAddresses);
    mail.setReplyTo('youremail@mail.com');
    mail.setSenderDisplayName('Your Name');
    mail.setSubject('Testing email through apex');
    mail.setBccSender(false);
    mail.setUseSignature(false);
    mail.setPlainTextBody('This is test email body.');
    //mail.setHtmlBody('<b> This is HTML body </b>' );//Enable if you want HTML content
    Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
}