Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

Why "email_sender" is not active with this web app project?

$
0
0

package : email_senderfirebase using : yes

I want to use the sender email in my project, so package "flutter_email_sender" isn't work beacause it's not for web app , then I try another one is "email_sender" and it's for web app project, I try it but it got "somethingWrong" error like this

------------Err Pic------------------------enter image description here------------Err Pic------------------------

-------------sent1() function-------------------------

import 'package:email_sender/email_sender.dart'; void sent1() async {    EmailSender emailsender = EmailSender();    var response =        await emailsender.sendMessage("phuris.s@ku.th", "a", "b", "c");    print(response["message"]);  }

-------------sent1() function-------------------------

------------ FloatingActionButton that I want to put sent1() in-------------------

Container(              height: size.height * 0.08,              width: size.width * 0.2,              decoration: BoxDecoration(                borderRadius: BorderRadius.circular(16),                color: Colors.blue[200],              ),              child: FloatingActionButton(                onPressed: () async {                  if (formKey.currentState!.validate() &&                      selectedValue1 == "ซินเนติก") {                    formKey.currentState?.save();                    try {                      String invoiceNumber = await generateInvoiceNumber();                      await _prdetailsCollection.add({"project": selectedValue4,"dropdowncompany": selectedValue1,"dropdowndep": selectedValue2,"dropdownwork": selectedValue3,"fsname": prdetails.fsnames,"date_pr": _dateController.text,"recommend_company": prdetails.recommendcompanypr,"phone": prdetails.phones,"email_pr": prdetails.emailprs,"number1": tablePR1.n1,"order1": tablePR1.o1,"des1": tablePR1.d1,"amount1": tablePR1.a1,"unit1": tablePR1.u1,"additonal1": tablePR1.add1,"number2": tablePR2.n2,"order2": tablePR2.o2,"des2": tablePR2.d2,"amount2": tablePR2.a2,"unit2": tablePR2.u2,"additonal2": tablePR2.add2,"number3": tablePR3.n3,"order3": tablePR3.o3,"des3": tablePR3.d3,"amount3": tablePR3.a3,"unit3": tablePR3.u3,"additonal3": tablePR3.add3,"number4": tablePR4.n4,"order4": tablePR4.o4,"des4": tablePR4.d4,"amount4": tablePR4.a4,"unit4": tablePR4.u4,"additonal4": tablePR4.add4,"number5": tablePR5.n5,"order5": tablePR5.o5,"des5": tablePR5.d5,"amount5": tablePR5.a5,"unit5": tablePR5.u5,"additonal5": tablePR5.add5,"number6": tablePR6.n6,"order6": tablePR6.o6,"des6": tablePR6.d6,"amount6": tablePR6.a6,"unit6": tablePR6.u6,"additonal6": tablePR6.add6,"number7": tablePR7.n7,"order7": tablePR7.o7,"des7": tablePR7.d7,"amount7": tablePR7.a7,"unit7": tablePR7.u7,"additonal7": tablePR7.add7,"number8": tablePR8.n8,"order8": tablePR8.o8,"des8": tablePR8.d8,"amount8": tablePR8.a8,"unit8": tablePR8.u8,"additonal8": tablePR8.add8,"number9": tablePR9.n9,"order9": tablePR9.o9,"des9": tablePR9.d9,"amount9": tablePR9.a9,"unit9": tablePR9.u9,"additonal9": tablePR9.add9,"number10": tablePR10.n10,"order10": tablePR10.o10,"des10": tablePR10.d10,"amount10": tablePR10.a10,"unit10": tablePR10.u10,"additonal10": tablePR10.add10,"scale1": tablePR1.scale1,"scale2": tablePR2.scale2,"scale3": tablePR3.scale3,"scale4": tablePR4.scale4,"scale5": tablePR5.scale5,"scale6": tablePR6.scale6,"scale7": tablePR7.scale7,"scale8": tablePR8.scale8,"scale9": tablePR9.scale9,"scale10": tablePR10.scale10,"สิ้นเปลือง": isChecked1,"อุปกรณ์-เครื่องมือ": isChecked2,"วัตถุดิบเพื่อการขาย": isChecked3,"วัตถุดิบเพื่อการซ่อมแซม": isChecked4,"วัตถุดิบเพื่อการผลิต": isChecked5,"purchase_req": invoiceNumber,"price1": tablePR1.price1,"price2": tablePR2.price2,"price3": tablePR3.price3,"price4": tablePR4.price4,"price5": tablePR5.price5,"price6": tablePR6.price6,"price7": tablePR7.price7,"price8": tablePR8.price8,"price9": tablePR9.price9,"price10": tablePR10.price10,                      }).then((value) {                        sent1();                        formKey.currentState?.reset();                        Fluttertoast.showToast(                          msg: "Submitted",                          gravity: ToastGravity.CENTER,                        );                        Navigator.pushReplacement(context,                            MaterialPageRoute(builder: (context) {                          return PipelinePurchase();                        }));                      });                    } catch (e) {}                  } else if (formKey.currentState!.validate() &&                      selectedValue1 == "ซินโนวิค") {                    formKey.currentState?.save();                    try {                      String invoiceNumber1 = await generateInvoiceNumber1();                      await _prdetailsCollection.add({"project": selectedValue4,"dropdowncompany": selectedValue1,"dropdowndep": selectedValue2,"dropdownwork": selectedValue3,"fsname": prdetails.fsnames,"date_pr": _dateController.text,"recommend_company": prdetails.recommendcompanypr,"phone": prdetails.phones,"email_pr": prdetails.emailprs,"number1": tablePR1.n1,"order1": tablePR1.o1,"des1": tablePR1.d1,"amount1": tablePR1.a1,"unit1": tablePR1.u1,"additonal1": tablePR1.add1,"number2": tablePR2.n2,"order2": tablePR2.o2,"des2": tablePR2.d2,"amount2": tablePR2.a2,"unit2": tablePR2.u2,"additonal2": tablePR2.add2,"number3": tablePR3.n3,"order3": tablePR3.o3,"des3": tablePR3.d3,"amount3": tablePR3.a3,"unit3": tablePR3.u3,"additonal3": tablePR3.add3,"number4": tablePR4.n4,"order4": tablePR4.o4,"des4": tablePR4.d4,"amount4": tablePR4.a4,"unit4": tablePR4.u4,"additonal4": tablePR4.add4,"number5": tablePR5.n5,"order5": tablePR5.o5,"des5": tablePR5.d5,"amount5": tablePR5.a5,"unit5": tablePR5.u5,"additonal5": tablePR5.add5,"number6": tablePR6.n6,"order6": tablePR6.o6,"des6": tablePR6.d6,"amount6": tablePR6.a6,"unit6": tablePR6.u6,"additonal6": tablePR6.add6,"number7": tablePR7.n7,"order7": tablePR7.o7,"des7": tablePR7.d7,"amount7": tablePR7.a7,"unit7": tablePR7.u7,"additonal7": tablePR7.add7,"number8": tablePR8.n8,"order8": tablePR8.o8,"des8": tablePR8.d8,"amount8": tablePR8.a8,"unit8": tablePR8.u8,"additonal8": tablePR8.add8,"number9": tablePR9.n9,"order9": tablePR9.o9,"des9": tablePR9.d9,"amount9": tablePR9.a9,"unit9": tablePR9.u9,"additonal9": tablePR9.add9,"number10": tablePR10.n10,"order10": tablePR10.o10,"des10": tablePR10.d10,"amount10": tablePR10.a10,"unit10": tablePR10.u10,"additonal10": tablePR10.add10,"scale1": tablePR1.scale1,"scale2": tablePR2.scale2,"scale3": tablePR3.scale3,"scale4": tablePR4.scale4,"scale5": tablePR5.scale5,"scale6": tablePR6.scale6,"scale7": tablePR7.scale7,"scale8": tablePR8.scale8,"scale9": tablePR9.scale9,"scale10": tablePR10.scale10,"สิ้นเปลือง": isChecked1,"อุปกรณ์-เครื่องมือ": isChecked2,"วัตถุดิบเพื่อการขาย": isChecked3,"วัตถุดิบเพื่อการซ่อมแซม": isChecked4,"วัตถุดิบเพื่อการผลิต": isChecked5,"purchase_req": invoiceNumber1,"price1": tablePR1.price1,"price2": tablePR2.price2,"price3": tablePR3.price3,"price4": tablePR4.price4,"price5": tablePR5.price5,"price6": tablePR6.price6,"price7": tablePR7.price7,"price8": tablePR8.price8,"price9": tablePR9.price9,"price10": tablePR10.price10,                      }).then((value) {                        sent1();                        formKey.currentState?.reset();                        Fluttertoast.showToast(                          msg: "Submitted",                          gravity: ToastGravity.CENTER,                        );                        Navigator.pushReplacement(context,                            MaterialPageRoute(builder: (context) {                          return PipelinePurchase();                        }));                      });                    } catch (e) {}                  }                },                backgroundColor: Colors.blueAccent[200],                child: Text("Submit Form",                  style: kBodyText,                ),              ),            ),

------------ FloatingActionButton that I want to put sent1() in-------------------

So why email_sender it's doesnt work, anyone try this email_sender? or who has another method to send email in flutter web app?


Viewing all articles
Browse latest Browse all 12111

Trending Articles