Giter VIP home page Giter VIP logo

aws-ses-node-js-examples's People

Contributors

andrewpuch 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-ses-node-js-examples's Issues

How to send a JPG attachment to the mail

This is my ses_mail value

var params = { Bucket: 's3mailattachments', Key: 'image.jpg' };
var attachmentData;
s3.getObject(params, function (err, data) {
    if (err)
        console.log(err, err.stack); // an error occurred
    else {
        console.log(data.ContentLength);
        console.log(data.ContentType);
        console.log(data.Body);
        var ses_mail = "From: 'AWS Tutorial Series' <" + email + ">\n";
        ses_mail = ses_mail + "To: " + email + "\n";
        ses_mail = ses_mail + "Subject: AWS SES Attachment Example\n";
        ses_mail = ses_mail + "MIME-Version: 1.0\n";
        ses_mail = ses_mail + "Content-Type: multipart/mixed; boundary=\"NextPart\"\n\n";
        ses_mail = ses_mail + "--NextPart\n";
        ses_mail = ses_mail + "Content-Type: text/html; charset=us-ascii\n\n";
        ses_mail = ses_mail + "This is the body of the email.\n\n";
        ses_mail = ses_mail + "--NextPart\n";
        ses_mail = ses_mail + "Content-Type: image/jpeg; \n";
        ses_mail = ses_mail + "Content-Disposition: attachment; filename=\"aadhar.jpg\"\n";
        ses_mail = ses_mail + "Content-Transfer-Encoding: base64\n\n"
        ses_mail = ses_mail + data.Body;
        ses_mail = ses_mail + "--NextPart";

        //console.log(new Buffer(data.Body.toString(),'binary').toString('utf8'));
        var fs = require('fs');

        var params = {
            RawMessage: { Data: new Buffer(ses_mail).toString('utf8') },
            Destinations: [email],
            Source: "'AWS Tutorial Series' <" + email + ">'"
        };

        ses.sendRawEmail(params, function (err, data) {
            if (err) {
                res.send(err);
            }
            else {
                res.send(data);
            }
        });

    }

the file is showing as corrupted when I open the image in gmail, when I tried to open it using apple photos, I has thrown the error, meta data of the image is missing

The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.

I tried your code in my API it shows some error like this

{
    "message": "The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.",
    "code": "SignatureDoesNotMatch",
    "time": "2019-03-26T09:17:35.688Z",
    "requestId": "fe4e7d29-4fa7-11e9-bc9c-73fcff5b59b9",
    "statusCode": 403,
    "retryable": false,
    "retryDelay": 82.02929132453885
}

This is my code

var AWS = require('aws-sdk'); //Email config
var ses = new AWS.SES();
exports.verifyEmail = (req, res) =>{
  var email   = "[email protected]";
  var params = {
      EmailAddress: email
  };
  ses.verifyEmailAddress(params, (err, data) =>{
      if(err) {
          res.send(err);
      } 
      else {
          res.send(data);
      } 
  });
}

Hello Critical

There is someone that thinks that the aws-sdk is broken?
As double check I've downloaded and runned the demo and after
some minutes my request to /send it's still waiting.

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.