Email that allows auto responses via subject line with attachments - email

i want to host a email client on my web server that allows messages to be processed via subject line, i looked into roundcube's autoreply but that was only a global message for all incoming emails, for example, if my customer emailed me with subject line HOSTING, it would be filtered and sent an auto response with an attached pdf file of our hosting plans

I would actually use Gmail's filters to do this, as otherwise it would be quite complicated. I would forward all the mail to Gmail, and use Gmail's filters (and canned response lab feature) to respond with the PDF attachment.

Related

Reliable way to relate emails in an email thread in SendGrid

Summary
How can SendGrid's Inbound Parse and send mail SDK be used to receive emails, respond then associate each new message in thread with the original email?
Setting the replyTo in the sending email is nice but isn't reliable as the user may respond to to other messages in the thread, such as the original message and hence miss this.
One solution we're trying is using message headers to associate emails by message ID. Not sure if this is reliable though?
This question is about best practice and finding the most reliable option.
This question doesn't apply to SendGrid alone but emails in general.
Code Snippets
shammelburg has a nice setup here that can be used to experiment.
Threads are usually something each email client can handle differently to visualize the items in your inbox. So it's not a standard you can rely on and not related to anything you can configure in the inbound parse or the client when you send an email.
Gmail and other large providers usually group emails that have the same subject line as the original email with a "RE: " prefix.
Here's an example: The subject of the original email: "Hello World" The subject line of your response: "RE: Hello World".

SendGrid is always sending my emails to the Spam folder of the recipient

I am trying to send an email from my Firebase Cloud Functions using the SendGrid's mail client for Node.js
I am following their example described as follows:
const sgMail = require('#sendgrid/mail');
sgMail.setApiKey(functions.config().sendgrid.key);
const msg = {
to: 'my_own_mail#gmail.com',
from: 'my_other_own_mail#gmail.com',
subject: 'Sending with Twilio SendGrid is Fun',
text: 'and easy to do anywhere, even with Node.js',
html: '<strong>and easy to do anywhere, even with Node.js</strong>',
};
sgMail.send(msg);
Once the function is fired, everything gets executed successfully. In my function logs I get Status 202 and the actual mail gets delivered but not in the main mailbox but rather in the Spam folder. When I open the message, it simply says:
I don't really understand what is the problem.
NOTE: If I send the message to an Yahoo email it doesn't go in the Spam folder. Same applies if I send it to my business email.
Your problem is not related to cloud functions or the code, there are a few anti-spam rules you need to follow, this gave me a good starting point
Sendgrid does not send your messages to the SPAM folder it all depends on the recipients mail delivery flow spam filters.
Most messages are marked as spam for one of the following reasons
1. Message is not authenticated properly
Validated that your message is authenticated properly with SPF or DKIM
2.Your message originates from an IP that is in a Blacklist (this might be on Sendgrid's)
Try by sending a message to your self and open the message headers , then look for entries like the one below
Received: from xxxxxxxxx.com (xxxxxxx.com [xxx.xx.xxx.xx])
by xxxx.com with SMTPS id ##############
The IP between [] is the sending server IP try to use public blacklist such as spamhaus to see if it is blacklisted and report to Sendrig if you find a match
3.The content of your message has known phishing techniques (accidentally or not)
Check the "Format your mail" section for Gmail senders guidelines as general recommendation

Send mass email with Gmail API

I want to send mass email with GMail API.
Currently I add all the addresses at the To section.
But every recipient should receive the mail and see only his address and not the other ones. Is there a method/API that I can use for this?
As far as I know, Gmail was not created for sending bulk emails as it restricts the number of recipients and has tons of other limitations. You should try to use third-party service for this.
Here you can find Gmail API limitation. It says
100 Recipients per message sent via SMTP (by POP or IMAP users) or the Gmail API

Email open tracking

I have to create email tracking system, but the problem is that when the sender opens an email this is counted as an opening by the recipient.
When I send an email through Polymail (or some other tools for tracking emails), then in the 'sent' folder I have an email without a tracking pixel, but the recipients of this email have the pixel and at the same time everyone have different code inside (I think, to determine which of the recipients opened the email).
How is this possible? The sender and the recipients have different contents of the same email. Can this be implemented using smtp / imap / gmail-api?
For standard IMAP/SMTP setups (specifically: not GMail), the message is submitted twice, once to SMTP to be sent, and again to IMAP to be placed in the Sent mailbox.
There is no requirement that these be the same: in fact, in normal use, the BCC header, for example, is submitted to IMAP, but not SMTP.
GMail, and a few others, while trying to be helpful and save bandwidth, do the copy automatically, but make it impossible to supply different versions. (Unless you want to try to find the duplicates and delete them out of band).
Current Email protocols don't send any kind of ACK to the Sender when mail is opened. So you need to put some kind of analytic tool inside the mail contents to keep the track of it.
Some suggested methods and widely used tool is Bananatag.
Alternatively, you can use custom Google Analytics for the same. Refer here https://dyn.com/blog/tracking-email-opens-via-google-analytics/

Routed google domain emails

i have an idea about system where users respond to website's messages using the emails they received.
Is it even possible to have multiple imaginary emails with hash in the e-mail's name field(f.e., 1h2149g0as1gasd9123#mysite.com ) and those all imaginary e-mails just forward content to messaging#mysite.com e-mail. And afterwards we are able to parse the contents and know for which conversation the message was sent.
The emails are hosted in Google service. Could not find any information about this in internet.
Such option would be excellent, because there would be no need of including the identificator in e-mail's content which might be deleted if no quoted text is in replied e-mail.
I'm open to any other suggestions that would fit in this situation.
When using Google's service, you can add tags after the e-mail address using a +. For example...
test#domain.com
test+12345#domain.com
test+wuishw78#domain.com
will all go through to test#domain.com, and you can then look at the address.
Note this is not supported by all e-mail systems, so while this works on Google's hosted e-mail, it may not work on others.