guileen / node-sendmail

send mail without setting up a SMTP server
http://guileen.github.com/node-sendmail
MIT License
559 stars 110 forks source link

Remove autoparse #64

Closed alancnet closed 5 years ago

alancnet commented 5 years ago

auto-parse doesn't work. autoParse('123 Words') === NaN. autoParse('123 Words'.substr(0, 3)) would work, but I don't think autoParse is necessary at all. It adds unneeded complexity to a simple task, and if you step through the code, it boils down to new Number(string) anyways. No need for the extra library.

I did not update the version. I believe this can easily be rolled into your next release.

Description

Replaces usage of autoParse with parseInt, and focuses on the first three characters of the line. The use of the magic number 3 is in keeping with line[3] === ' ' from a previous line. 🦎 Chameleon coding.

Motivation and Context

I was not able to send myself an email using simple examples.

How Has This Been Tested?

I modified the code, in situ, and I was able to send myself an email.

Screenshots (if appropriate):

Types of changes

Checklist: