Simple Email Service BCC not sending emails.

0

I am using the ses api to send emails. My code looks like this:

SendEmailRequest sendRequest = new SendEmailRequest()
{
	Source = fromEmail,
	Destination = new Destination()
	{
		ToAddresses = chunk,
		//BccAddresses = chunk
	},
	Message = new Message()
	{
		Subject = new Content(subject),
		Body = new Body()
		{
			Text = new Content()
			{
				Charset = "UTF-8",
				Data = message
			}
		}
	}
};

SendEmailResponse? response = await ClientSendEmail(client, sendRequest, CancellationToken.None);

The code above work when ToAddresses = chunk. When ToAddresses is commented out and BccAddresses is uncommented, nothing appears. I am testing with chuck being a simple list of two emails. One is a valid email, the second is an invalid email.

When ToAddresses is uncommented I get a single email (the valid one). I expect the same behavior for BccAddresses, but instead, I get nothing. Does SES not support BCC without a ToAddress?

asked 7 months ago461 views
2 Answers
1
Accepted Answer

Does SES not support BCC without a ToAddress?

The following page mentions you must specify a To address, so the answer is no, it doesn't.

https://docs.aws.amazon.com/ses/latest/dg/send-email-formatted.html

SendEmail requires a From: address, To: address, message subject, and message body—text, HTML, or both.

profile picture
HS
answered 7 months ago
profile picture
EXPERT
reviewed 7 months ago
0

module.exports.forgotPasswordEmail = async (event) => { try { const templateBody = Test; const emailParams = { Destination: { ToAddresses: [arjuntejaswi.s@gmail.com], BccAddresses: ["arjunrock160@gmail.com"], // Add your BCC email address(es) here CcAddresses: ["test@gmail.com"], }, Message: { Subject: { Charset: "UTF-8", Data: "Password Resend Request", }, }, Source: "no-reply@onarrival.travel", }; emailParams.Message.Body = { Html: { Data: templateBody, Charset: "UTF-8", }, }; return await SES.sendEmail(emailParams).promise(); } catch (error) { console.log("emailError", error); return error; } };

This is my SES email code and for some reason I am not able to see bcc in the email after triggered. Not sure why. Could someone help me here.

answered a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions