How do I send email from a react app using SMTP - reactjs

i have a webform written in react - i would like an email sent to an admin when someone submits something from it.
I had a look at emailjs which looked promising, but it looks like it was attempting to execute the email send at the browser side... duh!
How do I send the email from the server side (i.e. from the webserver) so that I may use the local smtp server to relay the email?

I'd spin up a node.js app and use nodemailer (https://nodemailer.com).
Also, beware that sending mail from 'localhost' is likely to get your messages caught in spam. I highly recommend using a service like mailgun.com (free) to delivery your messages so you don't have to worry about SPF records, DKIM records and IP Address "warmup".

Related

Not received emails even though the SendGrid activity shows Delivered

I have created Azure Logic App with Recurrence trigger and then used SendGrid connector for sending emails to multiple team members.
I didn’t receive any email even though the logic app actions executed successfully. After that I have checked SendGrid account email activity status, it is having “Delivered” status for the mentioned to email address in the SendGrid action.
Note: I have whitelisted the Outbound IP address of my logic app in SendGrid IP Address Management.
Twilio SendGrid developer evangelist here.
I don't know how Azure Logic Apps trigger emails with SendGrid, but if an email isn't being sent they shouldn't be getting the "Delivered" status.
You said that you have not set up Single Sender Verification or Domain Authentication. In order to send an email using SendGrid from the email address you provide, that email address should either have been verified as a Single Sender (which is mostly useful for testing) or it should be from a domain that you have authenticated with SendGrid.
Try setting one of those verification methods up and then try sending emails again.

how can I send emails from react using sendinblue?

I am working in React applications (using the .net core in the back-end)
I have to send emails from the client side , we have to use sendinblue instead of mailgun , I need your help
You should not send emails from the client side.
Consider that in doing so, you're going to expose your API Key to any client, leading to a severe vulnerability for your application (anyone could impersonate you and send emails as if they were you).
In order to really make that work, you should perform an AJAX request to your server and there, connect to the Sendinblue API and make the request to send the email. In this case, the API Key could be safely stored in your server.

Mail GAE not sending but

I have a problem sending mail with JavaMail Service in GAE.
I did all the code in the documentation, i debug it online and it work fine, and it count the mail sended in the quota section the problem is, i didn't receive anything, and also checked with the account sender and it's the same there isn't any trace of mail sended. I tried this for some mails address and it's not working too.
Anyone had this problem yet? A solution to this?
The problem is that the mail sended as SPAM on gmail account.
Read doc: https://cloud.google.com/appengine/docs/java/mail/#Java_Authenticating_mail_DKIM
The email used to send the mails must be a member of the application. It can be the problem... It was with me.
https://cloud.google.com/appengine/docs/python/mail/
The link is about python but for sure that the same email rules apply to Java.
For security purposes, the sender address of a message must be one of the >following:
The Gmail or Google Apps Account of the user who is currently signed in
Any email address of the form anything#appname.appspotmail.com or >anything#appalias.appspotmail.com
Any email address listed in Email API Authorized Senders found in the App >Engine Settings page of the Developers Console

how to send emails in jsp using securesocketlayer?

I have been using java mail to send mail from jsp to send emails.
But google is blocking my request and I am getting a message from gmail to my inbox as Signin attempt blocked.
In order to send mails from my account I have to update my security setting access permission to less secureapps but I don't want to do it.
So how to send mails using ssl in java mail?
The sample code I am using is:
properties.put("mail.smtp.auth", "true");
properties.put("mail.smtp.starttls.enable", "true");
The "less secure apps" setting has nothing to do with SSL. It's required to allow you to login using just a username and password, instead of using the (more complicated, but presumably more secure) OAuth2 authentication technique.

Receive mails through a port and extract body and headers

I am trying to build a proxy server in between my application and my smtp server. So when my application sends an email to some email id, my proxy server should catch it and change its "TO" address to my id and then send it to smtp server so that I'll get that message in my mail. This is a different case compared to reading messages from an inbox. I dont know how to distinguish each separate mail and get mail headers and body from each mail.
Any help would be greatly appreciated. Thanks in advance!
You should take a general look at JavaMail API and playing with it before asking for complete solutions.
Some other resources:
jGuru: Fundamentals of the JavaMail API
the JavaMail API - FAQ

Resources