How to send email on users behalf using AWS SES? - amazon-web-services

I can see that from SendGrid I can send email, where the from field will show any email which the end user will put. With AWS SES how can I achieve this?
As I see in the docs it needs to verify the email/domain before doing this. Is there a way to do this?

In SES you can only send emails from verified domains or verified emails. And in either cases you would need to own them otherwise you cannot verify them and subsequently you cannot use those.
Once you verify a domain it is more liberal in the sense that now you can use any arbitrary id at that domain
So e.g. if you verify xyz.com domain then you can use any id #xyz.com
E.g. myid1#xyz.com or jghdgd#xyz.com

That might be about policy
Not very familiar with send grid.
We use sparkpost as another ESP and there as well you can only use only authenticated domains. And that makes sense as well because otherwise people can just adopt any arbitrary identity for spamming

Related

AWS SES verified emails

Trying to understand something thats not clear from AWS SES emails.
I have a simple emailer on my website that I have setup using nodemailer.
It has 3 fields
Name: name of user filling out form
email: email address of user filling out email.
Description: description filled out by user.
I'm seeing in AWS docs that I need to verify on their console the users email.
You can only send mail from verified email addresses and domains.
Note: This restriction applies even when your account isn't in the
sandbox.
This could be any number of different user email address how would I be able to verify them all I wouldn't know them.
What am I not getting here. I have verified the To: email which will always be the same as its coming to my domain email.
You'll want to send from an email address under your control (SES enforces this on a technical level, but spam filters tend to de facto enforce this everywhere due to things like SPF records) with a Reply-To header of the email address submitting the form.

How can I use a single gmail address in a MTA (Mail Transfer Application)?

I would like to allow users to send automated emails from a dedicated email address (automated_alerts#my-domain.com).
However, in the scripts, I don't want to give users access to the credentials.json so that they can modify the scope. I don't want to use a service that I need to pay for such as Amazon SES.
I have looked into resources at the following links below, but I want users to simply specify an html body, any attachments, and the recipients and then forward this on to the MTA. If a user leaves the company, the automated emails should not fail when the user's email gets closed out. The script would just need to get moved to a different server's cron or whatever.
Is there an easy way to do this? I am happy to use Django also, but would prefer to avoid using SES and having to pay to send internal company emails:
https://docs.djangoproject.com/en/2.0/topics/email/
https://github.com/django-ses/django-ses
https://developers.google.com/gmail/api/auth/scopes

Send email with custom from with amazon ses for several domains

How can I accomplish to send email in Amazon SES with a custom email from for several domains.
For example, I have an application that is used by several clients, and we have a module to send emails. When we send an email it goes with the "amazonses.com domain", but what I want to accomplish is a custom from email for each client, each one has a different domain.
The process for doing this is entirely specific to the current SES configuration steps so its better I provide a link thats regularly updated.
http://docs.aws.amazon.com/ses/latest/DeveloperGuide/mail-from-set.html
The short summary is that you can do this by choosing a FROM option for the emails you are sending from.
Programmatically Setting From
The link above points how how to use the API to programmatically change the FROM value. The link below is directly to the API call for setting from but to accomplish it you'd still need to follow the manual tutorial then replace its steps with equivalent API Calls.
http://docs.aws.amazon.com/ses/latest/APIReference/API_SetIdentityMailFromDomain.html

"Read" Emails with Django

Currently sending emails with Django, and was wondering if there was any way to periodically check my inbox with Django (or ideally somehow alert the server upon receipt of a new email), and have Django extract the message and save it in the database.
You could use an email service such as SendMail or Mandrill (latter definitely has free accounts, former may have).
Each of these services provide inbound email support via webhooks. You provide them an endpoint to hit (make sure to use HTTPS) and when they receive an email to an address you have registered they will send the data via HTTP POST to you.
It is then just a simple case of storing this data to the database. There are a number of 3rd party packages that can help you with this:
http://djrill.readthedocs.org/en/v1.4/usage/webhooks/
https://github.com/yunojuno/django-inbound-email
https://github.com/jpadilla/mandrill-inbound-python
https://github.com/michaelhelmick/python-mailsnake
Although it's rather simple to roll your own should need be.

Get and Send messages through amazon api

My company is working with the amazon MWS api, and we are receiving a lot of messages from the customers about their orders.
Is there any way to get these messages using the web services and reply to them?
As #joshubrown pointed out correctly, there currently is no API to get customer messages or send replies. You can, however set up a separate mail account for that purpose, which (depending on your own server architecture) gives you a whole set of protocols like POP3, IMAP, SMTP or even MAPI. Regular emails sent to the "scrambled" customer email addresses will be relayed to the consumer and will shown up as replies in your Seller Central.
No, there isn't a public API for that.
How I was planning to do this (in the absence of an API) was to set up the email account (that would receive the emails from customers) such that it pipes the email content into a script. The script would then write the content to the database (or do whatever you want with it).
I'm using qmail for mail, and if you edit the .qmail file within an email account's folder you can set where to pipe the email content eg
| php /pathtoscript/emailHandlingScript.php
Other email systems will have a different syntax for this.
Then in your PHP code (if you're using PHP), you can grab the content from the stdin stream:
$fh = fopen('php://stdin')
I'll probably use PHP's mailparse functions (eg mailparse_msg_parse_file, mailparse_msg_get_part etc) to properly extract the data from the stream.
As #Hazzit points out, when you reply to the anonymised email address (eg qwugwquigduwqgiqwdgiuwqdg#amazon.co.uk), Amazon will pass it on to the customer.
I created users on my account, redirected mails and made a script to read and reply.