@sahilwa2 you can use the https://adobe-consulting-services.github.io/acs-aem-commons/features/e-mail/email-api/index.html email API, but again it internally use the SMTP configured in Day CQ Mail Service.
When you say you want to use API to send email, which API are you talking about ?