You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
About this code removed the 'gmail' and every time i make any change like insert public key, trying to send the message it fails.
const sendEmail = (e) => {
e.preventDefault()
emailjs.sendForm('gmail','service_','template_', form.current, {
publicKey: '*',
})
.then(
() => {
alert('Message successfully sent!')
window.location.reload(false)
},
() => {
alert('Failed to send the message, please try again')
}
)
}
Solved by attached the sendEmail function to an event and used e.preventDefault() to prevent the default form submission behavior:
About this code removed the 'gmail' and every time i make any change like insert public key, trying to send the message it fails.
const sendEmail = (e) => {
e.preventDefault()
emailjs.sendForm('gmail','service_','template_', form.current, {
publicKey: '*',
})
.then(
() => {
alert('Message successfully sent!')
window.location.reload(false)
},
() => {
alert('Failed to send the message, please try again')
}
)
}
Solved by attached the sendEmail function to an event and used e.preventDefault() to prevent the default form submission behavior:
emailjs.init({ publicKey: '* });
const sendEmail = (e) => {
e.preventDefault();
The text was updated successfully, but these errors were encountered: