2016-12-26 9 views
1

나는 내 자신의 SMTP 서버를 사용하여 대량 메일을 보낼 수있는 작은 대시 보드를 만들려고합니다. 이 노드를 사용하고 싶습니다. 다른 SMTP 서버에서 메일을 보내고 싶습니다.대량 메일 사용 node.js

+0

아래 [내 대답] (https://stackoverflow.com/questions/41329056/bulk-email-sending-usiing-node-js/41329154#41329154)이 도움이 되었습니까? 다른하실 말씀 있나요? 그렇다면 [대답 수락] (http://meta.stackexchange.com/a/5235/157646)을 고려하여 다른 사람들이 귀하의 질문에 대답이 있음을 알 수 있습니다. – rsp

답변

3

노드에서 전자 메일을 보내는 가장 일반적인 방법은 Nodemailer입니다. 그것은 훌륭한 문서를 가지고있다.

모든 SMTP 서버를 사용하여 전자 메일을 보낼 때 사용할 수 있으며 Gmail 또는 기타 특수 전송을 사용하여 많은 미리 구성된 방법으로 보낼 수 있습니다.

사용할 수있는 전송은 -의 README에서 : 드릴의 웹 API

  • nodemailer를 통해 메시지를 보내는 Mailgun의 웹 API를 통해
  • nodemailer-드릴-전송 메시지를 보내는

    • nodemailer-mailgun-전송 -pickup-pickup 픽업 폴더에 메시지를 저장하기위한 전송
    • Sailthru 웹 API를 통해 메시지를 보내기위한 nodemailer-sailthru-transport
    • nodemail AWS SES
    • nodemailer-sparkpost-전송을위한 메시지를 보내기 위해 sendmail 명령에 SendGrid의 웹 API를 통해
    • nodemailer-SES-수송 배관 메시지
    • nodemailer - 센드 메일 - 전송 메시지를 보내는 어 - sendgrid-전송
    • nodemailer - 스텁 전송 테스트 목적으로 대부분의 아마, 단지 메시지를 반환하는 SparkPost의 웹 API를 통해 메시지를되어 전송
    • nodemailer-잘 알려진 그 많은 지원되는 서비스 중 하나에 대한
    • nodemailer-소인-전송을 통해 메시지를 보내는 에스

      • : 소인의 웹 API를 통해 메시지를 종료하는 것은
      • 당신이 여기

    • 가 Nodemailer GitHub의의의 repo

      var nodemailer = require('nodemailer'); 
      
      // create reusable transporter object using the default SMTP transport 
      var transporter = nodemailer.createTransport('smtps://user%40gmail.com:[email protected]'); 
      
      // setup e-mail data with unicode symbols 
      var mailOptions = { 
          from: '"Fred Foo " <[email protected]>', // sender address 
          to: '[email protected], [email protected]', // list of receivers 
          subject: 'Hello ✔', // Subject line 
          text: 'Hello world ', // plaintext body 
          html: '<b>Hello world </b>' // html body 
      }; 
      
      // send mail with defined transport object 
      transporter.sendMail(mailOptions, function(error, info){ 
          if(error){ 
           return console.log(error); 
          } 
          console.log('Message sent: ' + info.response); 
      }); 
      

      페이지에서 간단한 사용 예이다 (여기 전송 API 문서를 참조) 추가 https://nodemailer.com/

    • https://github.com/nodemailer/nodemailer

    대량 메일의 경우 Mailgun 또는 Mandrill과 같은 서비스를 사용하는 것이 훨씬 더 좋습니다. SMTP를 사용하여 대량 메일을 보내면 이메일이 스팸 필터를 통과하는지, 전송을 위해 블랙리스트에 등록되지 않았는지 확인해야하기 때문입니다. 너무 많은 전자 우편, ISP의 한계를 초과하지 말라는 것 등등. 전자 메일을 보내는 것은 일반적으로 사람들이 생각하는 것보다 복잡하고 Mailgun의 전자 메일 당 $ 0.0001과 같은 가격으로 싸구려입니다.