Provide SMTP configuration
Using this method, you can:
- Send emails using your own domain
- Optionally customise the default email templates and subject.
- NodeJS
- GoLang
- Python
import supertokens from "supertokens-node";import ThirdPartyEmailPassword from "supertokens-node/recipe/thirdpartyemailpassword";import Session from "supertokens-node/recipe/session";import { STMPService } from "supertokens-node/recipe/thirdpartyemailpassword/emaildelivery";
supertokens.init({ appInfo: { apiDomain: "...", appName: "...", websiteDomain: "..." }, recipeList: [ ThirdPartyEmailPassword.init({ emailDelivery: { service: new STMPService({ smtpSettings: { host: "...", password: "...", port: 465, from: { name: "...", email: "...", }, secure: true }, }) }, }), Session.init() ]});
import ( "github.com/supertokens/supertokens-golang/ingredients/emaildelivery" "github.com/supertokens/supertokens-golang/recipe/thirdpartyemailpassword" "github.com/supertokens/supertokens-golang/recipe/thirdpartyemailpassword/tpepmodels" "github.com/supertokens/supertokens-golang/supertokens")
func main() { supertokens.Init(supertokens.TypeInput{ RecipeList: []supertokens.Recipe{ thirdpartyemailpassword.Init(&tpepmodels.TypeInput{ EmailDelivery: &emaildelivery.TypeInput{ Service: thirdpartyemailpassword.MakeSMTPService(emaildelivery.SMTPServiceConfig{ Settings: emaildelivery.SMTPSettings{ Host: "...", From: emaildelivery.SMTPFrom{ Name: "...", Email: "...", }, Port: 456, Password: "...", Secure: false, }, }), }, }), }, })}
from supertokens_python import init, InputAppInfofrom supertokens_python.recipe import thirdpartyemailpassword
from supertokens_python.ingredients.emaildelivery.types import EmailDeliveryConfig, SMTPSettingsFrom, SMTPSettings
init( app_info=InputAppInfo( api_domain="...", app_name="...", website_domain="..."), framework='...', recipe_list=[ thirdpartyemailpassword.init( email_delivery=EmailDeliveryConfig( service=thirdpartyemailpassword.SMTPService( smtp_settings=SMTPSettings( host="...", port=465, from_=SMTPSettingsFrom( name="...", email="..." ), password="...", secure=False ) ) ) ) ])
To learn about how to customise the default email templates or the subject, please see the next section.