deno-smtp icon indicating copy to clipboard operation
deno-smtp copied to clipboard

Error while using microsoft email for smtp

Open hiral-kotadiya opened this issue 3 years ago • 8 comments

Working fine with my Gmail credentials. I used the following credentials: For more port info click here

await client.connectTLS({
        hostname: "smtp.office365.com",
        port: 587,
        username: "***@mydomain.com",
        password: "*********"
});

Error:

DenoStdInternalError: bufio: caught error from `readSlice()` without `partial` property
    at assert (https://deno.land/[email protected]/_util/assert.ts:13:11)
    at BufReader.readLine (https://deno.land/[email protected]/io/bufio.ts:254:7)
    at async TextProtoReader.readLineSlice (https://deno.land/[email protected]/textproto/mod.ts:131:17)
    at async TextProtoReader.readLine (https://deno.land/[email protected]/textproto/mod.ts:33:15)
    at async SmtpClient.readCmd (https://deno.land/x/[email protected]/smtp.ts:151:20)
    at async SmtpClient._connect (https://deno.land/x/[email protected]/smtp.ts:118:21)
    at async SmtpClient.connectTLS (https://deno.land/x/[email protected]/smtp.ts:68:5)

hiral-kotadiya avatar Aug 05 '21 09:08 hiral-kotadiya

Hi there,

I have the same error but with the OVH domain using ssl0.ovh.net as hostname. Do you find a workaround ?

KentriLuigi avatar Aug 20 '21 12:08 KentriLuigi

Hi @KentriLuigi , No, I am not able to solve this issue yet.

hiral-kotadiya avatar Aug 23 '21 03:08 hiral-kotadiya

@KotadiyaHiral I found a workaround using "Send email as" functionnality from gmail, with the gmail settings but with my address as sender / from. It's not ideal, but it's working fine with my custom domain.

KentriLuigi avatar Aug 29 '21 16:08 KentriLuigi

@KotadiyaHiral I found a workaround using "Send email as" functionnality from gmail, with the gmail settings but with my address as sender / from. It's not ideal, but it's working fine with my custom domain.

You can also use the non secure method client.connect() For OVH you just need to change the port:

{
    hostname: "ssl0.ovh.net",
    port: 587,
    username: "[email protected]",
    password: "***********",
}

Sandroggy avatar Sep 30 '21 12:09 Sandroggy

Can confirm the issue is still present with Office 365, using the settings listed by @hiral-kotadiya.

Using client.connect() is not an option:

await client.connect({
        hostname: "smtp.office365.com",
        port: 587,
        username: "***@mydomain.com",
        password: "*********"
});

TimedOut: Operation timed out (os error 60) at async Object.connect (ext:deno_net/01_net.js:480:55) at async SmtpClient.connect (https://deno.land/x/[email protected]/smtp.ts:56:18) at async file:///Users/X/Developer/javascript/deno-windmill/main.ts:28:5 { name: "TimedOut", code: "ETIMEDOUT" }

craibuc avatar Nov 02 '23 13:11 craibuc

I'm going to clarify this for you. The following services don't just work with the same password you use to login to them. So App specific passwords were created to allow you to use email clients that don't support OAUTH 2.0.

Guess what Google, Microsoft, Yahoo & AOL use by default? OAUTH 2.0.

sample

This means you first need to generate an APP SPECIFIC PASSWORD, and then USE THIS APP SPECIFIC PASSWORD with this Deno SMTP library. Or with any email client that does not support oAUTH 2,0.

Take a look at the following links for how to generate this APP SPECIFIC PASSWORD.

Microsoft 365 - Manage app passwords for two-step verification

Google Gmail - Manage app passwords for two-step verification

Yahoo Mail - Generate and manage third-party app passwords

AOL - Create and manage third-party app passwords

iCloud - Using app-specific passwords

suchislife801 avatar Nov 02 '23 14:11 suchislife801

I added an app-specific password (ASP) for Office 365, using the method listed the the first link. I'm still getting the same error message. I'm assuming that I should be using the same email address as the account used to create the ASP.

What am I not understanding?

craibuc avatar Dec 11 '23 21:12 craibuc

For Outlook I have the following settings:

Outlook account (TERRIBLE SUPPORT FOR CRLF)

protocol: "STARTTLS"
auth: "LOGIN"
hostname: "smtp-mail.outlook.com"
port: 587
username: "[email protected]"
password: "tyvslvnidbwfelar"

Gmail account (FREE, SECURE, HIGHLY RELIABLE)

protocol: "TLS"
auth: "PLAIN"
hostname: "smtp.gmail.com"
port: 465
username: "[email protected]"
password: "oswwgfmqqrmujhth"

Yahoo account (FREE, SECURE, NOT RELIABLE)

protocol: "STARTTLS"
auth: "LOGIN"
hostname: "smtp.mail.yahoo.com"
port: 587
username: "[email protected]"
password: "yxfhgumeahrtpesw"

AOL account (FREE, SECURE, NOT RELIABLE)

protocol: "STARTTLS"
auth: "LOGIN"
hostname: "smtp.aol.com"
port: 587
username:  "[email protected]"
password: "efgmzisytrdfmiow"

iCloud account (FREE, SECURE, HIGHLY RELIABLE)

protocol: "STARTTLS"
auth: "LOGIN"
hostname: "smtp.mail.me.com"
port: 587
username: "[email protected]"
password: "jdsr-mers-fbjhl-meak"

suchislife801 avatar Dec 13 '23 12:12 suchislife801