2017-06-28 16 views
-4

私はサプライヤーからmanege注文を開始したいと思います。 私は注文ページを作成します。私は新しい注文をすることができ、 第2の側のサプライヤは注文を見て、すべての商品のステータスを更新することができます。自動送信更新メール

私が必要とするのは、注文を送信する際にサプライヤにメールを自動的に送信することです。また、各アイテムの出荷準備が整った場合も同様です。

できるだけ適切な方法[可能であればPHPはありません]?それはnode.jsと同じですか?私がFormspreeにチェックを入れたときに、それは1つのメールアドレス(contact-usフォームのようなもの)に送信するためだけのものでした。

は、あなたがNodemailerを使用することができ、Node.jsのからの電子メールを送信するには、あなたに

+2

ので、基本的にあなたが求めているもののNode.jsでメールを送信する方法、ありますか? – matiit

+0

[Nodemailer](https://nodemailer.com/about/)をご覧ください。 –

答えて

0

ありがとうございます。 (メインのウェブサイトからコピー)

例:

const nodemailer = require('nodemailer'); 

// create reusable transporter object using the default SMTP transport 
let transporter = nodemailer.createTransport({ 
    host: 'smtp.example.com', 
    port: 465, 
    secure: true, // secure:true for port 465, secure:false for port 587 
    auth: { 
     user: '[email protected]', 
     pass: 'userpass' 
    } 
}); 

// setup email data with unicode symbols 
let mailOptions = { 
    from: '"Fred Foo " <[email protected]>', // sender address 
    to: '[email protected], [email protected]', // list of receivers 
    subject: 'Hello ✔', // Subject line 
    text: 'Hello world ?', // plain text body 
    html: '<b>Hello world ?</b>' // html body 
}; 

// send mail with defined transport object 
transporter.sendMail(mailOptions, (error, info) => { 
if (error) { 
    return console.log(error); 
} 
console.log('Message %s sent: %s', info.messageId, info.response); 
}); 
関連する問題