[英]Connect to Secure Socket Server written in C++ with client written in JavaScript
[英]Mail client unable to contact smtp server(written in C++)
我的smtp服務器是用C ++編寫的。 郵件客戶端使用HTML和JS。 我使用smtpjs庫發送郵件。 Web服務器的Apache。 但是,郵件客戶端根本無法聯系smtp服務器。 Wireshark不顯示任何SMTP交換。
我的IP是NAT后面的192.168.0.105。
EmailJs網站連接到SMTP服務器,僅檢查SMTP連接。 發生連接超時。
<!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>
期望確保客戶端與smtp服務器聯系並且交換了HELO。
在SmtpJS的Host部分中將IP更改為localhost。 下一個錯誤是“服務器不支持安全連接”。 這意味着應該在Web服務器上啟用SSL,這需要弄清楚。
<!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>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.