Skip to content
Back

not receiving mails from custom SMTP server setup on appwrite

  • 0
  • Cloud
INAKA
29 Dec, 2024, 14:42
TypeScript
suspend fun sendPasswordRecoveryEmail(userEmail: String,context: Context) {
        val account = Account(client)

        try {
            account.createRecovery(
                email = userEmail,
                url = "https://Showgo.in/reset-password"
            )

            withContext(Dispatchers.Main) {
                Toast.makeText(
                    context,
                    "Reset email sent successfully!",
                    Toast.LENGTH_LONG
                ).show()
            }
        } catch (e: AppwriteException) {
            withContext(Dispatchers.Main) {
                Log.e("AppwriteRepository", "Error sending reset email: ${e.message}")
                Toast.makeText(
                    context,
                    "Failed to send reset email: ${e.message}",
                    Toast.LENGTH_LONG
                ).show()
            }
        }
    }
TL;DR
Developers are not receiving emails from a custom SMTP server setup in their app. Disabling the custom SMTP results in instant email reception. A code snippet for sending verification emails is provided for review.
INAKA
29 Dec, 2024, 14:42

i am sending the verification mail through this code, though i am sure it has no error, but just in case...

INAKA
29 Dec, 2024, 14:43

when i am disabling the Custom SMTP the mails are received instantly

INAKA
29 Dec, 2024, 14:43

but with custom SMTP, nopee..

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more