# Flutter
Flutter (opens new window) is an open source framework by Google for building beautiful, natively compiled, multi-platform applications from a single codebase.
Below is an example of a function that sends emails with some template parameters and returns true or false values based on the result. It uses the emailjs (opens new window) package for flutter.
import 'package:emailjs/emailjs.dart' as emailjs;
Future<bool> sendEmail(dynamic templateParams) async {
try {
await emailjs.send(
'YOUR_SERVICE_ID',
'YOUR_TEMPLATE_ID',
templateParams,
const emailjs.Options(
publicKey: 'YOUR_PUBLIC_KEY',
),
);
print('SUCCESS!');
return true;
} catch (error) {
if (error is emailjs.EmailJSResponseStatus) {
print('ERROR... ${error.status}: ${error.text}');
}
print(error.toString());
return false;
}
}
← Angular React Native →