Code Monkey home page Code Monkey logo

Comments (7)

andris9 avatar andris9 commented on July 20, 2024

Hi

Nodemailer requires SMTP and can't send e-mails without it. There are other e-mail libs though that use sendmail instead of SMTP (for example https://github.com/aheckmann/node-email) or you can do it yourself with

require("child_process").exec("mail -s \"something\" ... ")

I might add sendmail support to Nodemailer in the future but so far haven't thought about it.

from nodemailer.

andris9 avatar andris9 commented on July 20, 2024

Well now I thought about it and adding sendmail support seems highly locigal as the main goal for Nodemailer is to send e-mails and the exact way to do it is irrelevant. So whenever I have the free time I'll add the support for it.

from nodemailer.

xeoncross avatar xeoncross commented on July 20, 2024

Thanks for the input! I'm still rather new to the email stuff and all I know is that I have postfix setup correctly using DKIM and SPF. So the concept of "connecting" using full SMTP seemed like a waste of resources.

I'll look forward to your additions as having valid UTF-8 email (unlike the library you linked too) is very useful for my apps.

from nodemailer.

andris9 avatar andris9 commented on July 20, 2024

Hi,

I added sendmail support - just use

nodemailer.sendmail = true;

instead of

nodemailer.SMTP = ...

from nodemailer.

xeoncross avatar xeoncross commented on July 20, 2024

Wow, that was quick! Thanks!

from nodemailer.

chenny avatar chenny commented on July 20, 2024

@andris9 how to nodemailer with postfix?

from nodemailer.

knoxcard avatar knoxcard commented on July 20, 2024

Wow, this worked for me. I have Postfix/OpenDKIM, so every message I send attaches the DKIM header.
My personal email accounts work great using SMTP/StartTLS. For some reason, Nodemailer wont play nice with it, even though I am connecting to Postfix with the same configuration as Thunderbird.

Switching over to another MTA was the answer for me. By using sendmail, then including the nodemailer DKIM attribute, I am now able to send the correct DKIM signature! Without the sendmail attribute below, it would send the signature twice under the Postfix/OpenDKIM setup, causing a failure.

sendmail: app.nconf.get('ENV') == 'LIVE' ? true : false,
dkim: {
    domainName: 'mydomain.io',
    keySelector: 'mail',
    privateKey: require('fs').readFileSync('data/mail.private')
}

from nodemailer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.