My smtp server is written in C++. The mail client is in HTML and JS. I use smtpjs library to send mail. Apache for the web server. However, the mail client is unable to contact the smtp server at all. Wireshark does not show any SMTP exchange.
My IP is 192.168.0.105 which is behind a NAT.
EmailJs website to connect to the SMTP server to check the SMTP connection alone. There is a connection timeout which happens.
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script src="https://smtpjs.com/v3/smtp.js"></script> <script> function showMsg() { $( document ).ready(function() { Email.send({ Host : "192.168.0.105", Username : "shwetha@localhost.com", Password : "123456", To : 'shwetha@localhost.com', From : "shwetha@localhost.com", Subject : "This is the subject", Body : "And this is the body" }).then( message => alert(message) ); }) } </script>
The expectation is to make sure that the client contacts the smtp server and HELO is exchanged.
Changed the IP to localhost in the Host part of SmtpJS. The next error is "Server does not support secure connections." which means SSL should be enabled on the web server which needs to be figured out.
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://smtpjs.com/v3/smtp.js"></script>
<script>
function showMsg() {
$( document ).ready(function() {
Email.send({
Host : "localhost",
Username : "shwetha@localhost.com",
Password : "123456",
To : 'shwetha@localhost.com',
From : "shwetha@localhost.com",
Subject : "This is the subject",
Body : "And this is the body"
}).then(
message => alert(message)
);
})
}
</script>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.