Skip to content
Back

Failed sending to target forbidden error

  • 0
  • Self Hosted
  • Web
Karl
23 Jul, 2025, 13:58

// Send test email using the specific target ID await messaging.createEmail( 'unique()', // messageId 'Test Email, // subject '<p>Test<p/>', // content [], // topics (empty) [], // users (empty when using targets) [targetId], // targets (using the specific target ID) [], // cc (empty) [], // bcc (empty) [], // attachments (empty) false, // draft (false = send immediately) true // html (true for HTML content) );

When using this code to send an Email i get the following error in the appwrite console "Failed sending to target theEmailISpecified with error: Forbidden"

what is the cause of this?

My custom smtp server is setup and magic link emails are also sent out after i enter mine for loggin in, the email address also has a target

TL;DR
An error occurred while sending an email to a specific target. The issue is likely due to a permissions error or incorrect setup in the messaging createEmail function. Ensure that the targetID is correct and the necessary permissions are set up to send emails to that target.
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