Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Can not connect to any smtp server ( With screenshots ) #63

Open
lacari3ff opened this issue Aug 16, 2019 · 4 comments
Open

Error: Can not connect to any smtp server ( With screenshots ) #63

lacari3ff opened this issue Aug 16, 2019 · 4 comments

Comments

@lacari3ff
Copy link

lacari3ff commented Aug 16, 2019

I am building a own SMTP server, i am using node-smtp, node-sendmail. I can recieve email but not send them. I forwarded everything, and configured everything. As shown bellow. But it still not works.

My ISP does not block any ports. And windows firewall is open.

Screenshot_4

Screenshot_3

Screenshot_2

Screenshot_1

Expected Behavior

Sending a email to a address

Current Behavior

Error: can not connect to any SMTP server
    at tryConnect (C:\Users\Luke Rieff\Documents\GitHub\luke-smtp\smtp\node_modu
les\sendmail\sendmail.js:88:49)
    at Socket.<anonymous> (C:\Users\Luke Rieff\Documents\GitHub\luke-smtp\smtp\n
ode_modules\sendmail\sendmail.js:94:13)

Possible Solution

I think some configuration is wrong, please help. Been debugging for 19 hours, and no result.

Steps to Reproduce (for bugs)

// The modules
const fs = require("fs");

const sendmail = require("sendmail")({
  silent: true,
  dkim: {
    // Default: False
    privateKey: fs.readFileSync("../keys/private-key.key", "utf8"),
    keySelector: "default"
  }
});


// Sends the mail
function send(cb) {

  sendmail(
    {
      from: "luke@fannst.nl",
      to: "somename@gmail.com",
      subject: "hi",
      html: "hi"
    },
    (err, reply) => {
      if (err) {
        console.log(err);
        cb(false);
      } else if (reply) {
        cb(reply);
      } else {
        cb(false);
      }
    }
  );
}

Context

I am trying to make a SMTP server, sending and recieving.

Your Environment

  • Version used: Latest
  • Environment name and version: Nodejs Latest
  • Operating System and version (desktop or mobile): Windows 10
@lacari3ff lacari3ff changed the title Error: Can not connect to any smtp server ( Including images ) Error: Can not connect to any smtp server ( With screenshots ) Aug 16, 2019
@GreenPioneer
Copy link
Collaborator

@lacari3ff at the moment I do not have the bandwidth to help - nor do I see what is wrong right off the bat

@lacari3ff
Copy link
Author

@GreenPioneer Ah okay, thanks anyway. I currently have a temporary solution from sendgrid. If you know how i could solve this later, please comment.

@micktaiwan
Copy link

@lacari3ff is it related to #19 ?

@Ant-V
Copy link

Ant-V commented Aug 26, 2020

I have the same issue and I found something weird: if I call the api through an axios call from a web app, it gives this exact error. If I do it through Postman, it goes through fine.

One thing I want to note is I do not import sendmail directly, but due to me using it as part of strapi, I instead use strapi.plugins['email'].services.email.send

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants