'How to solve the smtpjs error with gmail smtp host
I am working with smptjs to send email using javascript. The code was working fine until today morning.
I am getting the error "Only elasticemail is supported as an SMTP host. To open an account please visit https://elasticemail.com/account#/create-account?r=20b444a2-b3af-4eb8-bae7-911f6097521c"
I tried to search for this error and unsuccessful, any help in this matter would be appreciated.
This is my js code to send the email
const name = form.elements["name"].value;
const from = form.elements["email"].value;
const companyName = form.elements["company-name"].value;
const businessType = form.elements["business-type"].value;
const isOperatingBusiness = form.elements["business"].value;
const emailBody = `<h3>Please find the details below</h3>
<hr />
<span><strong>Name:</strong> ${name}</span><br />
<span><strong>Email Address:</strong> ${from}</span><br />
<span><strong>Contact No:</strong> ${phone}</span><br />
<span><strong>Company Name:</strong> ${companyName}</span><br />
<span><strong>Operating Business:</strong> ${isOperatingBusiness}</span><br />
<span><strong>Business Type:</strong> ${businessType}</span><br /><br />
<span>Thank you,</span><br />
<span>appiGo Team</span>`;
const emailObject = {
Host: HOST,
Username: USERNAME,
Password: PASSWORD,
To: DEV_MAIL,
From: FROM,
Subject: `${subject} ${name}`,
Body: emailBody,
};
Email.send(emailObject).then((message) => {
if (message == "OK") return onSuccess();
});
Thank you in advanced!
Solution 1:[1]
Unfortunately, due to abuse (spam / phishing) SMTPJS.com has been limited to trusted SMTP providers. Currently the recommended SMTP provider is ElasticEmail, other SMTP providers may be considered in future.
Solution 2:[2]
Elastic Email is an Email Service Provider and you can create a free trial account here https://elasticemail.com/account#/create-account to get access to the email delivery engine and SMTP relay. With a trial, you can send up to 100 emails/day. For more, you have to pay.
That's probably the only option now with smptjs.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Fiach Reid |
Solution 2 | Kaja |