Skip to content

A scalable flutter package used to integrate email services in your applications for free and gives a better experience between server and client.

License

Notifications You must be signed in to change notification settings

afriddev/email_sender

Repository files navigation

📧 Email Sender

Pub Version License: MIT

Now with HTML Support! Easily send rich HTML emails with full styling support directly from your Flutter app.

Email Sender Banner

GitHub

This is how your HTML email could look!

Email Sender is a powerful and lightweight Flutter package for integrating email functionality directly into your app. Whether it's sending basic emails, OTPs for verification, or beautifully formatted HTML messages — this package has you covered.


📦 Installation

Add the package using the Flutter CLI:

flutter pub add email_sender

Or manually add it to your pubspec.yaml:

dependencies:
  email_sender: ^2.0.1

Then run:

flutter pub get

🚀 Features

  • ✅ Send plain emails
  • 🔐 OTP-based email verification
  • 📝 Custom messages (title, subject, body)
  • 💡 Directly send raw HTML strings
  • 📄 Send HTML templates (prebuilt or custom)
  • 🔑 Use your own email credentials (e.g., Gmail App Password)
  • 🛠️ Developer-friendly API with helper methods

🧪 Usage Examples

✅ Initialization

EmailSender emailsender = EmailSender();

📤 Send a Basic Email

var response = await emailsender.send("[email protected]");
print(response["message"]);

🔐 Send OTP

var response = await emailsender.sendOtp("[email protected]", 123456);

📝 Send Custom Message

var response = await emailsender.sendMessage(
  "[email protected]",
  "Your Title",
  "Your Subject",
  "Your message body here",
);

💡 Send HTML String

var response = await emailsender.sendHtml(
  "[email protected]",
  "<h1>Welcome!</h1><p>This is an HTML email.</p>",
);

📄 Send HTML Template

EmailSender htmlSender = EmailSender(
  "[email protected]",
  "passkey",
  "[email protected]",
  "Template Title",
  "Template Subject",
  "<h1>HTML Body from Template</h1>"
);
var response = await htmlSender.customMessage();

📖 App Password Setup (Gmail)

If you're using Gmail, generate an app password to send emails securely.
👉 Generate App Password


📚 Additional Resources


👨‍💻 Author

Shaik Afrid
🔗 Portfolio


About

A scalable flutter package used to integrate email services in your applications for free and gives a better experience between server and client.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages