Thursday, 24 June 2021

Sending Email Without Opening Third Parties Apps In Flutter

  No comments

Email is one of the oldest message sending techniques present today. The email was created in 1972 by Ray Tomlinson. So now you know a little bit about the history of the email, and if you want to know more about the history of the email please refer to this link

Now, Let's jump into the implementation and the very first thing you need to do is to download the mailer package 


Use this package as a library:

Run this command: 

With Dart:

 $ dart pub add a mailer

With Flutter:

 $ flutter pub add a mailer

This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):

dependencies:

  mailer: ^5.0.0

Now in your Dart code, you can use:

import 'package:mailer/mailer.dart';

After done with the above setup, add the below code and modified it according to your need. 


Note: You need to allow the less secure app access from your Gmail like as showing in the screenshot





No comments :

Post a Comment

Loading...