Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.addCc("email@domian.com) not sending mail #162

Closed
securitybites opened this issue May 1, 2015 · 12 comments
Closed

.addCc("email@domian.com) not sending mail #162

securitybites opened this issue May 1, 2015 · 12 comments

Comments

@securitybites
Copy link

When using .addCc("email@domain.com), the email is never actually sent to the CC address. However it is listed in the email CC field on the email that is sent to the .addTo() recipient.

@eddiezane
Copy link
Contributor

There is a breaking change that needs to be implemented in this library that will default to using our Web API parameters as opposed to currently using the SMTP API Header for to email addresses. The SMTP API Header does not support cc or bcc addresses.

A fix for the time being is to explicitly use the Web API parameters:

email.to = ['foo@example.com', 'bar@example.com'];
email.addCc('baz@example.com'); // same as email.cc = 'baz@example.com'

Appologies for the confusion.

@juanpgaviria
Copy link

Hi,

I have the same issue with cc and bcc, i try with email.cc and email.addCc and no email its sent to the cc addres..

@eddiezane
Copy link
Contributor

Hi @juanpgaviria,

I just confirmed that it does indeed work with these methods.

var sg = require('sendgrid')(process.env.SENDGRID_APIKEY);

var email = new sg.Email();

email.to = 'foo@example.com';
email.subject = 'Testing CC + BCC';
email.from = 'me@example.com';
email.text = 'Testing';
email.addCc('bar@example.com');
email.bcc = 'baz@example.com';

sg.send(email, function(err, json) {
  if (err) console.error(err);
  console.log(json);
});

Please test with the latest version of the library and share a code sample if it still doesn't work.

@juanpgaviria
Copy link

@eddiezane

it works.. i was adding the bcc as array.. i think that the issue.. after 3 jack daniel's anything can happend.

thanks ;).

@eddiezane
Copy link
Contributor

Haha no worries! I realized that we were missing addBcc and setBccs so I just released a new version - 1.8.0 with them.

@jcksncllwy
Copy link

Hi there! I believe I may have found a related bug. If email.addTo("foo@example.com") is called before email.addCc('bar@example.com') then the cc email is not sent.

var sg = require('sendgrid')(process.env.SENDGRID_APIKEY);

var email = new sg.Email();

email.addTo('foo@example.com');
email.subject = 'Testing CC + BCC';
email.from = 'me@example.com';
email.text = 'Testing';
email.addCc('bar@example.com');
email.bcc = 'baz@example.com';

sg.send(email, function(err, json) {
  if (err) console.error(err);
  console.log(json);
});

@vinhtq
Copy link

vinhtq commented May 21, 2015

I have the same problem, cannot send email to bcc or cc email address!
Does anybody have solution?

@vinhtq
Copy link

vinhtq commented May 21, 2015

One more problem, i try to to as @eddiezane way and it works but in the cc or bcc the substitution not working! Only body content display!

@jacquesgingras
Copy link

I am still having this issue as well. Whether I add the cc using setCcs or addCc, it displays in the email that the To recipient receives, but the recipient in the CC address doesn't receive it.

@kunal732
Copy link

kunal732 commented Sep 4, 2015

@jacquesgingras, @ohhdear, @mbernier Looking into this right now. It appears that when the to field is set in the x-smtpapi header, it ignores the cc param. If we just set to using the WEB API params, cc works fine.

@tushdante, can you verify that and update the lib to not set to in the smtpapi header when cc is set.

@mbernier
Copy link
Contributor

mbernier commented Sep 8, 2015

@kunal732 @tushdante we'll get this prioritized in the backlog to get it taken care of.

Thanks!

@hsalazr
Copy link

hsalazr commented Sep 9, 2015

yep i had the same issue. with "sendgrid": "^1.9.2",

This way just send "to" and ignores "bcc"

email.addBcc('samplecopy@mail.com');
email.addTo('sample@mail.com');

This way send to both

email.bcc ='samplecopy@mail.com';
email.to = 'sample@mail.com';

so "it works" :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants