manyuanrong / deno-smtp

SMTP implements for deno
MIT License
78 stars 26 forks source link

Name or service not known #16

Open epomatti opened 4 years ago

epomatti commented 4 years ago

This example was running couple days before and now it gives me an error:

error: Uncaught Error: failed to lookup address information: Name or service not known
    at unwrapResponse ($deno$/ops/dispatch_json.ts:43:11)
    at Object.sendAsync ($deno$/ops/dispatch_json.ts:98:10)
    at async Object.connectTls ($deno$/tls.ts:20:15)
    at async SmtpClient.connectTLS (https://deno.land/x/smtp/smtp.ts:36:18)
    at async file:///home/pomatti/projects/bizi-infrastructure-code/deno-smtp/deno.ts:13:1
import { SmtpClient } from "https://deno.land/x/smtp/mod.ts";
import { ConnectConfigWithAuthentication } from "https://raw.githubusercontent.com/manyuanrong/deno-smtp/master/config.ts";

const client = new SmtpClient();

const params = <ConnectConfigWithAuthentication>{
  hostname: "smtp.google.com",
  port: 465,
  username: "someemail@gmail.com",
  password: "pa$$word"
}

await client.connectTLS(params);

await client.send({
  from: "someemail@gmail.com", // Your Email address
  to: "someemail@gmail.com", // Email address of the destination
  subject: "Mail Title",
  content: "Mail Content,maybe HTML",
});

await client.close();
$ deno --version
deno 1.0.3
v8 8.4.300
typescript 3.9.2