codeigniter4 sending email with attachments

In this section, we’ll see how to sent email with attachments using email library.

To send the email with attachments, first we need to load the email’s library.

        $email = \Config\Services::email(); // where email() is static method of Services class.

        $email->setFrom('', 'Your Name');
	    $email->setSubject('Email Subject');
            // file attach here //



That’s it!. Please share your thoughts or suggestions in the comments below.

Leave a Reply

Your email address will not be published. Required fields are marked *