weaver / node-mail Goto Github PK
View Code? Open in Web Editor NEWThis SMTP client library for Node.JS helps you send email safely and easily.
This SMTP client library for Node.JS helps you send email safely and easily.
when i use this library in windows. i tryed run the example ''client.js' , i get an error : typeError: Object has no method 'enter'
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(); });
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)?
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.
In versions 3.3.2 and later always expect error that "object <#client> has no setSecure() method". Why is it?
seems to be a race condition. The following change to index.js in Client.prototype.mail
fixes it :
process.nextTick(function() { self.session(); })
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.
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.
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.
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 ?
there is either a missing or an extra '\r\n' (\015\012).
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" }
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.
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().
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
Totally a minor thing, but it would be really nice if npm packages had an obvious link back to the source repo. I had to search around to finally find weaver/node-mail. A "Source can be found at http://github.com/weaver/node-mail" would have saved me a few minutes.
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]
Hi!
Please, consider using (str||'').toString()
in L#18 of base64.js
--Vladimir
the title says it all.
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();
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.