mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #522 from anchann/master
Nodemailer: type definitions for the SMPT-specific options
This commit is contained in:
@@ -80,4 +80,26 @@ transport.sendMail(message, function (error) {
|
||||
return;
|
||||
}
|
||||
console.log('Message sent successfully!');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// From the SMTP section of https://npmjs.org/package/nodemailer README
|
||||
|
||||
var smptTransport1: Transport = nodemailer.createTransport("SMTP", {
|
||||
service: "Gmail", // sets automatically host, port and connection security settings
|
||||
auth: {
|
||||
user: "gmail.user@gmail.com",
|
||||
pass: "userpass"
|
||||
}
|
||||
});
|
||||
|
||||
var smtpTransport2: Transport = nodemailer.createTransport("SMTP", {
|
||||
host: "smtp.gmail.com", // hostname
|
||||
secureConnection: true, // use SSL
|
||||
port: 465, // port for secure SMTP
|
||||
auth: {
|
||||
user: "gmail.user@gmail.com",
|
||||
pass: "userpass"
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Vendored
+23
-7
@@ -69,21 +69,37 @@ interface XOAuth2Options {
|
||||
|
||||
interface NodemailerTransportOptions {
|
||||
service?: string;
|
||||
auth?: {
|
||||
user?: string;
|
||||
pass?: string;
|
||||
XOAuthToken?: XOAuthGenerator;
|
||||
XOAuth2?: XOAuth2Options;
|
||||
};
|
||||
auth?: NodemailerAuthInterface;
|
||||
debug?: bool;
|
||||
AWSAccessKeyID?: string;
|
||||
AWSSecretKey: string;
|
||||
ServiceUrl: string;
|
||||
}
|
||||
|
||||
interface NodemailerAuthInterface {
|
||||
user?: string;
|
||||
pass?: string;
|
||||
XOAuthToken?: XOAuthGenerator;
|
||||
XOAuth2?: XOAuth2Options;
|
||||
}
|
||||
|
||||
interface NodemailerSMTPTransportOptions {
|
||||
service?: string;
|
||||
host?: string;
|
||||
port?: number;
|
||||
secureConnection?: bool;
|
||||
name?: string;
|
||||
auth: NodemailerAuthInterface;
|
||||
ignoreTLS?: bool;
|
||||
debug?: bool;
|
||||
maxConnections?: number;
|
||||
}
|
||||
|
||||
|
||||
interface Nodemailer {
|
||||
createTransport(type: string): Transport;
|
||||
createTransport(type: string, options: NodemailerTransportOptions): Transport;
|
||||
createTransport(type: string, options: NodemailerSMTPTransportOptions): Transport;
|
||||
createTransport(type: string, path: string): Transport;
|
||||
createXOAuthGenerator(options: XOAuthGeneratorOptions): XOAuthGenerator;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user