- I have a form created on my index.html - modal that pops up when clicked.
- Form is simple NAME: EMAIL: MESSAGE - SEND
- It is for a subscription that needs to be 'mailed' to me (with name/email/message body)
- Presently on HostGator. They do not use smtp - must be php. I know zero about php. I don't have time to sit and study it just for this one element on the webpage. (future goals maybe)
I am working with tutorials for this project. The following script was before I learned I could not use smtp. I do not want to create index.php etc, files. I would prefer to remain html with just the send portion of php. Kindness appreciated.
<script src="https://smtpjs.com/v3/smtp.js">
</script>
<script>
function sendEmail(){
Email.send(
{
Host : "smtp.gmail.com",
Username : "testing@gmail.com",
Password : "XXDDDSSS",
To : 'main-account@gmail.com',
From : document.getElementById("email").value,
Subject : "New Connection",
Body : "Name: " + document.getElementById("name").value + "<br> Email: " + document.getElementById("email").value + "<br> Message: " + document.getElementById("message").value
}).then(
message => alert("Message sent successfully")
);
}
</script>