Skip to content

aiaaee/Sending_Email_React

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 

Repository files navigation

Sending Email Message by React

Using EmailJs is one of the most important decision of project

In this project, we aim to send a message to the user's email using the emailJs tool. At the beginning of the project, we design our form in the Request section.

The entire design of this form is handled by Bootstrap.

By using rows and segmenting sections of the page with columns, we create a fully responsive page.

Requests

After completing the JSX part of the project, we proceed to send the messages generated through the form. Using the npm website, we download the npm-com package. Then, we complete its code using the documentation provided in the send-form section. The syntax provided by the emailJs documentation is as follows:

emailjs.sendForm(serviceID, templateID, templateParams, options);

It should be noted that in the templateParams section, we can use a function we created to access the target and place them in this section.

Then, using ReactToastify in the then section, we specify that if the sending status is successful, it should send us a success message. If it fails to properly recognize the email, it should send us an error message.

Installation

npm i react-toastify

imports

import {ToastContainer , toast} from 'react-toastify'
import 'react-toastify/dist/ReactToastify.css';

Requests3

Finally, if we check our email, we will see that it has been successfully sent.

Requests2

The written codes can be viewed in the source section.