1

サーバー側 (wakanda 10) で、次のメールを送信します。

var mail = require('waf-mail/mail');
var message = new mail.Mail();
message.from = 'emailadres of the sender';
message.to = [theEmailadres];
message.subject = 'Here the subject of the email';
message.setBodyAsHTML('Here the HTML content of the email');
message.send('smtp.gmail.com', 465, true, 'username', 'password');

その後、手順が凍結されているように見えます。デバッガーを閉じると、ログファイルに次のエラーが表示されます。

2016-05-11 15:17:55 [com.wakanda-software.xbox] エラー - [1] / 壊れたパイプ (kOTSerialOverrunErr / EPIPE)、タスク #21523、タスク名は HTTP 接続ハンドラ

誰にもアイデアがありますか?

4

1 に答える 1

2

message.sendの代わりにmail.sendを使用し、 domain: 'gmail.com'を send() に渡されるオブジェクトに追加します。

var mail = require('waf-mail/mail'); 
var message = new mail.Mail();
message.subject = "Here the subject of the email";
message.from = "emailadres of the sender";
message.to = 'theEmailadres';
message.setBodyAsHTML("Here the HTML content of the email");
mail.send({
    address: 'smtp.gmail.com', 
    port: 465,
    isSSL: true,
    username: 'username', 
    password: 'password', 
    domain: 'gmail.com'
}, message);

Google が接続試行をブロックする可能性があることに注意してください。その場合、送信者の Gmail アカウントの設定で「安全性の低いアプリへのアクセス」を有効にします。安全性の低いアプリによるアカウントへのアクセスを許可する

于 2016-05-11T15:40:52.883 に答える