Node.js: AWS SES sendRawEmail: mails not getting sent to BCC addresses - node.js

I am sending a mail with attachments using mailcomposer and the sendRawEmail method of the AWS SDK. I am able to send the emails using the to and cc fields but when I add an address in bcc, the mail does not get delivered. There is no failure though. Is there any extra configuration not mentioned in the docs that I might be missing ?

I found the answer in one of the issues of mailcomposer. You need to add one extra config in the mail options.
var mail = mailcomposer(options);
mail.keepBcc = true;

Related

Mime_content in reply email (exchangelib, python)

First - I use the exchangelib package to connect to EWS exchange.
I will create a reply to the email as follows:
msg = acc.inbox.all().order_by('-datetime_received')[-1]
mgs.reply_all("Re: Subject", "body of email")
But the response created this way doesn't have the mime_content option, which I need to be able to save the email as .eml or .msg.
The msg variable has mime_content.
Is there a way to create an email reply with mime_content?
Thanks a lot!
reply_all() does not return anything. It's just a helper for sending a reply to the email it's called on.
If you want to access the Message item that the reply created, you need to search your "Sent" folder for the reply. That message has the mime_content field you're looking for.
If you call msg.create_reply_all(subject, body).send() instead, then you should get back the ID of the item stored in the "Sent" folder so you don't have to search for it.

I want to send email attachment using nodemailer in node js.i am using elasticemail gate way

I need to send a URL attachment in nodemailer.i try to many ways but mail was not deliverd.I was seen elasticemail gateway they showed a error like this "suppressed" how will i solve this issue
attachments:[{ // use URL as an attachment
filename:'GSTR3B_33ADQFS8223E1ZY_012019_1551501263.pdf',
path:'my url'}]
if you are getting "suppressed" from Elastic Email check in the Contacts section on your dashboard to be sure that the contact is in an "Active" state. The contact might be suppressed by the system.

Send emails through gmail using flask-mail

I have a simple CRUD webapp set up in Python/Flask, when one particular function is activated (approving a request) I'd like to send an email notification to the user, but for all I've tried I can't get the email to send through my code.
Here is my config file with all the relevant environment variables set (inside of a Config object):
MAIL_SERVER = 'smtp.gmail.com'
MAIL_PORT=465
MAIL_USE_SSL=True
MAIL_USERNAME = '**#gmail.com'
MAIL_PASSWORD = '**'
I have also tried calling app.config.update(those values) in my app/init.py file. Here is the current code to do so
mail = Mail()
def create_app(config_name):
app = Flask(__name__, instance_relative_config=True)
app.config.from_object(app_config[config_name])
app.config.from_pyfile('./config.py')
app.config.update(
MAIL_SERVER='smtp.gmail.com',
MAIL_PORT=465,
MAIL_USE_SSL=True,
MAIL_USE_TLS=False,
MAIL_USERNAME = '**#gmail.com',
MAIL_PASSWORD = '**')
mail.init_app(app)
And finally here is the code where I actually attempt to send the email:
msg = Message(html=html, sender='**#gmail.com', subject='Your Reservation for %s' % reservation.item.name, recipients=['**'])
mail.send(msg)
Additionally, it currently fails silently and I don't know how to even view what error is happening. Any help is much appreciated!
My suggestion in the comments was indeed the answer to the question.
Enabling "Less Secure Apps" in the Google Account settings was the necessary step to fix the hangup the OP was experiencing. This link from Google's support page walks you through how to enable this option.
I think, you should switch your sending protocol to TLS
this is sample from my project
MAIL_SERVER='smtp.gmail.com',
MAIL_PORT=587,
MAIL_USE_TLS=True,
MAIL_USERNAME = '**#gmail.com',
MAIL_PASSWORD = '**'
for me this works very well.
Now that Google is removing the less-secure app access feature due to security reasons, the best way to get around this is to use Sendgrid. They provide 100 free emails per day forever. You can register your same Gmail address as a single sender in SendGrid. Generate an API key and use it in your flask app to send emails.
For reference: Sending Emails from Python Flask Applications With Twilio SendGrid

Is there a way to send the verification email with the Firebase Admin SDK from my Node.js server?

Is there a way to send the email verification email from my server ?
This is how it's done on the client:
authData.sendEmailVerification().then(function() {
Is there a way to do it on the server ?
firebaser here
To my surprise there currently is no option to send verification email from within the Admin SDK. I'd recommend you file a feature request.
What you can do from the Admin SDK is update a user profile to mark their email as verified. This allows you to take control of the entire verification flow if you want to, finishing with a call to admin.auth().updateUser(...) (on Node.js, see the link for other supported languages).
I just came across the same problem as you. There is a function to generate the verification link using user's email address.
I used this function on an array of email addresses, then load the result to my mail automation API to send mails out. This function is weirdly not documented:
admin.auth().generateEmailVerificationLink([EMAIL_ADDRESS])
You can use :
axios.post('https://identitytoolkit.googleapis.com/v1/accounts:sendOobCode?key=[API_KEY]',
{ requestType: 'VERIFY_EMAIL', idToken: response.data.idToken }
)
https://firebase.google.com/docs/reference/rest/auth#section-send-email-verification

How to get body of mail by message-ID or any header

I'm creating an email app. To save time, I just download subject and some header and saved them to database, not download body of mail.
And then, If user click on subject, I will download body of this mail.
I try to use Message-ID (because it's unique) to make it is an index. and Using this code to find this mail on server
SearchTerm term = new MessageIDTerm(ID);
message_s = folder.search(term);
But it just success on GMAIL, some other server, this code doesn't work correct.
I try to get All message-ID and compare it on client side, It toke a lot of time to find, user can't wait too long to get body of email.
Anyone has an idea to find and download body of email correctly by Message-ID or by any header ?

Resources