Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ballerina: How do connect with SMTP server and send email?

I am looking at WSO2's Ballerina programming language. I don't see the module or package that allows the ballerina code to call SMTP server and send email. The only thing close to SMTP is the Gmail connector, but that is not what I am looking for. I expect to write a Ballerina script to chain some services/endpoints but also want to trigger an email by utilizing the company's internal SMTP relay server. Does anybody have any idea?

like image 575
chj915 Avatar asked Nov 26 '25 08:11

chj915


1 Answers

You can import email module in ballerina org into your .bal file and send emails.

import ballerina/email;

Please refer to the following documentation depending on your Ballerina version path for email sending capabilities.

[1] Swan Lake Alpha2 - https://ballerina.io/learn/by-example/send-email.html
[2] V1.2.x - https://ballerina.io/1.2/learn/by-example/send-and-receive-emails.html

like image 84
Suhan Dharmasuriya Avatar answered Nov 28 '25 00:11

Suhan Dharmasuriya