Can I send email via pure javascript - mailgun

I'm using mailgun as my mail service,
I wonder how to using mailgun to send email via pure javascript in a static website, no backend program

Mailgun does not support a plain JavaScript (with no Backend) interaction. You cannot make AJAX request to Mailgun.
This is actually a good thing for security/safety of your application. Also Mailgun requires server-side authentication (over HTTPS) for all your endpoints, so think about using cURL, nodejs, ruby, python or Java as a way better option to interact with Mailgun
Happy emailing!

Related

How to send email with Amazon SES using a pure HTTP request?

I want to send email using the Amazon SES without using aws-sdk. I need to send it using just a pure HTTP request. In other words, how can I send email with Amazon SES using cURL?
SES has email service and it is possible to quite easily check what is being sent with some external tool to sniff the requests that are being sent from your computer. On the other hand, keep in mind that if you want to do it purely using cURL, you have to also handle authentication and signing your requests before, which will create a lot of additional work.
Here you have example request syntax:
https://docs.aws.amazon.com/ses/latest/APIReference-V2/API_SendEmail.html
Link for the signature (I believe that was the things that oyu were looking for) etc:
https://docs.aws.amazon.com/ses/latest/APIReference/CommonParameters.html
Here you have the link for the endpoints:
https://docs.aws.amazon.com/general/latest/gr/ses.html

How does Postman retrieve cookies from the server?

I am implementing consuming a REST API. My development environment is not C#, cURL, PHP, or any other commonly-used environment. I am using a Postman collection furnished by the API's developers as a base for my implementation. Issuing the request works:
Postman screen capture
Automatically added cookies
When I disable the Cookie Jar, the request no longer works in Postman.
I believe that what I need to do is to imitate whatever Postman is doing to retrieve those cookies and include them in the header of my request. How is Postman retrieving those server-side cookies?

Identify URL of webpage when I can only receive API calls from the websites backend server

So I have a tricky problem of trying to somehow identify the url of a webpage, but I only have info on it's backend server that makes API calls to my server.
I have a server that receives API calls from another server running PHP. The clients PHP server receives information from a webform on their website. I am trying to the match API calls I receive with the webpage that submitted the data. Requesting the client to add a url in the API call will not guarantee that they haven't provided a fake one.
I was wondering if there is something I could do with a hidden iframe that could receive some sort of token or cookie from my server, then pass it to the PHP server who then includes it in the API call. Then I could match the url of the page I sent the token to with the API call.
Is this practical / possible? Any other suggestions of how to solve this problem??

Facebook login with Django and Javascript

I want to implement a Facebook login on my website that runs with Django. I have found a really good post explaining how to use the Facebook Javascript SDK here: https://www.sammyk.me/best-practice-for-facebook-login-with-the-javascript-sdk-and-php-sdk-v4-1
My problem is that I need to be able to access the facebook token from server side code. It seems this token is encrypted in a cookie and we can decrypt this cookie using the PHP SDK (as stated in the part "Using the JavaScript SDK and PHP SDK together" from the article).
However, I don't use PHP. Is there a simple way in Python to get this access token? Can I get it using the javascript SDK and maybe send an AJAX request to my server?
If not, do I need to manualy build a login flow?
It turns out I can get the token using only javascript using var access_token = FB.getAuthResponse()['accessToken'];. I can then send it to my server.

FireBase connect to server (Not NodeJS)

So I've seen this answer Using NodeJs with Firebase - Security that talks about syncing NodeJS with the Firebase data structure.
I don't use NodeJS (being a Railo/Coldfusion developer) and was wondering if something like this is possible outside of NodeJS? Through java or maybe just using REST endpoints. Or do I have to use the original solution in the above link of separately updating the data in my webserver.
Another way of wording it is; can I make a round trip from firebase to an HTTP server that isn't nodeJS?
EDIT: To clarify, exactly what I wanted to do was have a email webservice post to the REST API of Firebase, then firebase post that to an URL on my external railo server as my users need to know when the email arrives but the server just needs to make sure it stores it.
As I understand it my best bet is to get the email webservice to post to the URL on my railo server which then posts to the REST API on firebase.
Yes you can.
Firebase does not have a Coldfusion client library, so you need to use the REST APIs. You can use the REST API to read / write Firebase data from your server code.
The one thing you'll be missing is the notifications when data changes. With the node.js client, you can subscribe for updates to data but there's no way to do that from a REST API.
So if you need to know when Firebase data changes, and you're using REST, you'll have to poll the data periodically.
(Note: This is mostly copied #Michael's answer in the comments)