簡體   English   中英

郵件客戶端無法聯系SMTP服務器(用C ++編寫)

[英]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。

  1. 我嘗試了端口轉發,並確保為路由器中的端口轉發設置了端口25。 但這行不通。
  2. 路由器上的DDNS。 坦率地說,我不確定如何設置它。 無論我嘗試了什么,都行不通。
  3. 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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM