79756766

Date: 2025-09-05 12:27:25
Score: 5.5
Natty:
Report link

I have similar issues with forms in emailjs.

sendEmail(form: NgForm) {
    if (form.valid && this.formRef) {
      emailjs.sendForm('SERVICE_ID', 'TEMPLATE_ID', this.formRef.nativeElement, 'PUBLIC_KEY')
        .then(() => {
          this.successMessage = 'Your message has been sent successfully!';
          this.errorMessage = null;
          form.resetForm();
        }, (error) => {
          this.errorMessage = 'There is an error: ' + error.text;
          this.successMessage = null;
        });
    }
  }

In my code I use correct Service_ID, Template_ID and Public_key, everything works, but it always shows me that formRef is NULL!
Do someone know the solution?

Reasons:
  • Blacklisted phrase (1): I have similar
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Me too answer (2.5): I have similar issue
  • Ends in question mark (2):
  • Low reputation (1):
Posted by: Perwij Wu