GithubHelp home page GithubHelp logo

node-mail's People

Contributors

jhurliman avatar weaver avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

node-mail's Issues

used in windows error

when i use this library in windows. i tryed run the example ''client.js' , i get an error : typeError: Object has no method 'enter'

couldn't get example to work

Hi - I was trying out your example with Gmail, but I couldn't get it to work.
It gets as far as 235 '2.7.0 Accepted', but then hangs.

The raw methods worked however :

var client = mail.createClient(587, 'smtp.gmail.com');
client.setLogin('******', '*****');
client.on('error', function(err) {
  client.end();
  throw err;
});

var from = '[email protected]',
    to = "[email protected]",
    transaction = client.mail(from, [to]);

transaction.on('ready', function() {
  this.write("...").end();
});

transaction.on('end', function() {
  client.quit();
});

doesn't work with node >= 0.4

This snippet is supposed to provide some insight on the 0.2 -> 0.4 migration of net.Stream. I don't have the time right now to look over your code closely enough to apply it.

https://gist.github.com/848444

Is this something you're likely to fix soon (days or weeks)?

Session already started.

I copied the example code:

/// mail -- send an email
//
// This is the simplest, safest way to send an email.  Headers are
// escaped and folded, email addresses are validated, and the body is
// validated and wrapped.

var sys = require('sys'),
    mail = require('../lib').Mail({
      host: 'smtp.gmail.com',
      username: '[email protected]',
      password: '**password**'
    });

mail.message({
    from: '[email protected]',
    to: ['[email protected]'],
    subject: 'Hello from Node.JS'
  })
  .body('Node speaks SMTP.')
  .send(function(err) {
    if (err) throw err;
    sys.debug('Sent!');
  });

once I run it, I am getting an error: Session already started.

Add homepage to package.json

Can you please add the following keys to the package.json?

{
  "homepage": "https://github.com/weaver/node-mail",
  "repository": { "type": "git", "url": "https://github.com/weaver/node-mail.git" },
  "bugs": { "url": "https://github.com/weaver/node-mail/issues" }
}

At least the homepage would be great, that way people can find the repo simply by doing npm docs mail.

Thanks for the library.

Error for body has non-ascii charecters.

Tring sending Japanese mail, I got the error "Data must be 7-bit ASCII.'
It causes in ClientTransaction.prototype.write = function(data).
Comment-outed the checking 7bit, I can send the mail.

Do you have better ways for non-ascii char in body?
// Also I need the solution for non-ascii in subject.

May i set a charset to a subject and body ?

Hi there!

I couldn't send a mail by node-mail.

Actually, i couldn't see the body of mail that is written by node-mail .

Because the body of mail was written in korea.

I think that

when i write a e-mail in korea , i need to insert some string , that is a charset , on the head of body or subject.

So I am looking that part for modification of header.

Please let me know at your earliest convenience which a file should be modified.

[Bug] -- ECONNREFUSED

Hi,

I use node v0.4.8 and I have an error with this stack trace :

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: ECONNREFUSED, Connection refused
at Socket._onConnect (net.js:601:18)
at IOWatcher.onWritable as callback

Perhaps you can fix this with add this code to ./node-mail/lib/smtp.js l.66:

.....
this.sock
.on('error', function(err) {
self.emit('error', err);
})
.once('connect', function() {
.......

What do you think ?

Update your docs

Docs say:

"Node Mail has been tested against qmail and gmail using Node version v0.1.103. A working subset of these RFCs are supported:"

package.json says:
"engines": { "node": ">= 0.4.0 < 0.5.0" }

accentuated subject & body

Hello,

your library doesn't support accentuated mail subject, and in body it doesn't work for all clients : works on gmail but not on zimbra webmail.

this.domain causes failure since node 0.8.8 uses a domain field on EventEmitter

Seems that event emitters in node 0.8.8 have a domain member that conflicts with your usage of domain. There is a problem in events.js at line:

events.js:80
this.domain.enter();
^
TypeError: Object has no method 'enter'

where is the local hostname of my machine.
I see in your code you're defining the domain to be either the passed in domain value or OS.hostname().

Modified node-mail to send text/html

Hi guys,

Wasn't sure where to post this.

I made a simple modification to lib/mail/message.js like this to allow for HTML to be sent via node-mail. Node-mail was the only solution that I could get working for some reason.

// [Message Format](http://tools.ietf.org/html/rfc5322)
function Message(headers) {
  if (!(this instanceof Message))
    return new Message(headers);

  this._sender = null;
  this._recipients = null;
  this.headers = {};
  this._body = '';

  if (headers) {
    for (var key in headers)
      this.headers[util.titleCaseHeader(key)] = headers[key];
  }

  if (!('Date' in this.headers))
    this.headers['Date'] = util.date();

  if (!('Content-Type' in this.headers))
    this.headers['Content-Type'] = "text/html";
}

Message.prototype.HEADERS = ['Date', 'Sender', 'From', 'To', 'Cc', 'Subject', 'Content-Type'];

Hope this helps or is accepted into the code.

Regards

Error Fetching hostname on OS X

Hi, trying to use the library on OS X, I receive this stack trace when sending:

Error: Process exited with code 1
at ChildProcess. (/usr/local/lib/node/.npm/mail/0.1.0/package/lib/mail/util.js:296:16)
at ChildProcess.emit (events:33:26)
at ChildProcess.onexit (child_process:151:12)
at node.js:769:9

Seems the -f option doesn't exist on os x...
$ hostname -f
hostname: illegal option -- f
usage: hostname [-s] [name-of-host]

base64

Hi!

Please, consider using (str||'').toString() in L#18 of base64.js

--Vladimir

StartTLS error in node 0.4.8

var error = pair._ssl.verifyError();

TypeError: Cannot call method 'verifyError' of undefined
    at SecurePair.<anonymous> (/Users/johnhurliman/Code/cull/CullService/node_modules/mail/lib/starttls.js:18:27)
    at SecurePair.emit (events.js:61:17)
    at SecurePair.maybeInitFinished (tls.js:598:10)
    at CleartextStream._push (tls.js:269:17)
    at SecurePair.cycle (tls.js:574:20)
    at EncryptedStream.write (tls.js:96:13)
    at Socket.ondata (stream.js:36:26)
    at Socket.emit (events.js:64:17)
    at Socket._onReadable (net.js:678:14)
    at IOWatcher.onReadable [as callback] (net.js:177:10)

According to an issue file at xmppjs/xmpp.js#21 and a comment at https://gist.github.com/848444 it appears that the undocumented tls.js had a breaking API change and pair._ssl is now pair.ssl. I propose changing the line to var error = (pair.ssl) ? pair.ssl.verifyError() : pair._ssl.verifyError();

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.