Ionic 2/Typescript Mailgun API sends with success but no email ever seems to be sent - ionic-framework

I have an Ionic 3 app that has some code that fires an email to a recipient once a certain action is triggered. When I test this in the browser, I get the preflight issue and so I get around this using a Google Chrome plugin that allows me to enable CORS and when I actually execute the function, I get a success that looks like:
Headers {
ok:true,
status:200,
statusText:"OK",
type:2,
url:"https://api.mailgun.net/v3/https://api.mailgun.net/v3/<my-domain>/messages",
_body:"Mailgun Magnificent API"
}
However, an email is never sent to the address provided. It's not in spam or anything either. Does anyone know what might be causing this?

Check these three things :
1) Your URL seems very strange, with nested https://. It should be simply https://api.mailgun.net/v3/<my-domain>/messages
2) Make sure you validated your Mailgun account before trying to use it
3) Are you in sandbox mode ? If yes, did you add authorized recipients ? If not, you can't send any email.

Related

Getting rendered emails for Sandgrid Sandbox mode

I use SendGrid Sandbox mode and I get a response from API with 200 OK status code.
Is there a way I can check email content that I've created in this way?
I tried to find such Emails in SendGrid app or Google documentation for that. My first guess was that I will find such emails in Activity section of SendGrid app, but was not able to do it using email address I've sent emails to.
Thank you!

when sending a verify email request from keycloak via sendgrid, the resulting url is wrongly encoded

I have a keycloak (4.4.0-Final) installation.
Scenario:
sendgrid is configured as mail agent (and test mail sending is ok)
I create a new user in keycloak admin console and I pass it the action "verify email"
I get an email with a link to verify my email address, but when I click the link, I get the error "We're sorry...
An error occurred, please login again through your application."
I now have a closer look at the URL and I see 2 times = => http://keycloakurl/.....login-actions/action-token?key=eyJhbGciOiJIUzUx...&client_id=client-...
When I change = to = , the url works.
Does someone know if this is a bug in sendgrid, or a bug in the keycloak templates?
I know you have moved ahead with Mailjet but I would like to share my solution here as it may help others. I noticed this issue only happens if Email Tracking is enabled at SendGrid side. Try after disabling all tracking configurations under Setting -> Tracking screen.
The issue was not keycloak, but sendgrid (ref: https://issues.jboss.org/browse/KEYCLOAK-8536). We fixed the issue by dropping sendgrid and going to mailjet.

Sendgrid returns 202 but doesn't send email

I'm trying to get the basic "hello world" of sendgrid working, but have so far been unsuccessful. The response returns code 202, suggesting that it will send the email, but the email never sends out. Does anyone know what's going on?
import sendgrid
sg = sendgrid.SendGridAPIClient(apikey='**my-api-key**')
data = {
"personalizations": [
{
"to": [
{
"email": "me#gmail.com"
}
],
"subject": "Hello World from the SendGrid Python Library!"
}
],
"from": {
"email": "me#gmail.com"
},
"content": [
{
"type": "text/plain",
"value": "Hello, Email!"
}
]
}
response = sg.client.mail.send.post(request_body=data)
print(response.status_code)
I just had this issue: I created an account with SendGrid and tried to get the basic example working, the API would return a 202 response, but the email was never sent, and the SendGrid web UI's activity feed showed no activity.
I submitted a SendGrid support ticket and ~8 hours later received a response saying that they had disabled my account's ability to send emails:
Hello,
Thanks for contacting SendGrid Support!
It looks like your account has been closed by our compliance team and this is the cause of the issue.
To reactivate we’d like to know a little more about the email you’ll be sending through SendGrid. Please elaborate on the following:
The nature of your business, the services you provide, and your potential customer base
Your sending frequency and volume
How you collect your recipient addresses (link to opt in page, or sign up process)
How you will allow your recipients to opt out of your emails (whether you plan to use SendGrid’s one-click unsubscribe feature, or if you have your own method)
The types of messages you will be sending (transactional or marketing)
Please reply at your earliest convenience in order to continue the activation process. Thanks for your cooperation!
~15 hours after submitting my answers, I received a response saying my account had been "activated":
Hi nathan.wailes,
Thanks for the additional information! Your SendGrid account has been
activated, and can now be used to send email. To get started, check
out our Getting Started page.
If you hit any snags while you're getting set up, you can find
solutions to common problems and FAQS in our Knowledge Base.
Let me know if you have any more questions!
Best,
Stevin O.
Associate Support Engineer
When I then ran the basic example code with my email address set up as the recipient, the email showed up immediately in my Gmail inbox.
Debug this by going to the sendgrid api log here:
https://app.sendgrid.com/email_activity
In my case, it was a DMARC receiving domain block.
The 202 Accepted Status Code returned from SendGrid does not really indicate that the message has been successfully delivered to the recipients inbox. It indicates that the message is valid and has been "Queued For Delivery". Now, it is up to the receiving server to deliver this message to the recipients inbox, or to send it to spam, or simply drop the message.
There are several reasons as to why messages that returns 202 Accepted Status code from SendGrid does not actually get delivered to the recipients inbox.
For example:
Invalid email address: The email address may no longer be valid (example, when an employee stops working at some company, their email might be removed from the company's system removing the ability to receive any email).
Blocked Emails: If the sending IP or domain is blocked or if the recipients inbox provider has some filters set up such that some specific content of your email/campaign is considered spammy and thus gets automatically blocked.
Another thing to note is that SendGrid may send the messages to spam/junk if the domain authentication has not been properly set up. So make sure that your domain is properly authenticated.
Here is the link to the documentation from SendGrid that explains these event in details. https://sendgrid.com/blog/delivered-bounced-blocked-and-deferred-emails-what-does-it-all-mean/
I had same issue and solved it by adding new api key with full access
In case someone will come across this looking for an answer to a similar problem. I solved the same problem by confirming the domain with DNS records - after that everything worked like charm.
In Sendgrind: Setting > Senders Authentication > Domain Authentication
For us, the problem was that the used dynamic template was not yet set to "active". Unfortunately no error was shown about the in the API response or the log.
Activating the email template solved this and emails are no longer dropped.
The same issue occurred when DNS is not verified and you are not using register email in from email.
Just change from email to register email.
I recently got the same issue. My e-mails were not sent without any reason, the response status was 202, e-mail activity was empty. The possible solution is to add a company details and add an unsubscribe block to e-mail. That worked for me.
I'm implementing a password reset feature and it's a little weird to have an unsubscribe block for this. I'll try to figure out what was the real reason of such silent suppression. Probably it's because I tried to send a draft debug e-mail several times which was looked like a spam. Maybe SendGrid has some smart algorithms for detecting this.
I also had this issue. I contacted sendgrid support however while waiting I changed the dummy data to real data I was calling sendgrid API with and then it started working.
in particular I changed the from email address to show my own domain.
For me the template was the issue. When using the template engine make sure to use {{variable}} instead of {{ variable }}. Afterwards I received the emails as usual.

Receiving email on mailgun

I'm trying to use mailgun for it's SMTP service. The place I am trying to use it sends an email to the address entered as the "username":
postmaster#portal.example.com
I set up mailgun for receiving email within my DNS settings:
I've checked mailgun.org and made sure it sees the changes:
I have no idea where to see these actual emails, I've checked around the mailgun dashboard but I'm not finding it, I've checked logs and saw that the message was "accepted" but no delivered log.
I tried creating postmaster#portal.example.com on the host and then tried sending the validation code again but I didn't receive anything.
Help would be appreciated, thank you.
For Mailgun to handle the incoming emails for you, you need to add Routes.
Check the documentation on Routes to get started. It´s really quite straight forward.

Launch Mail app to check for new email

I know how to launch the Mail app to write a new email (using mailto). But I have a facility for users who have forgotten their password to get it sent to their email, and when they submit the request I would like to launch the Mail app, preferably in their Inbox.
Is there a way to do this?
Not possible. Confirmed by Apple.
If it is possible, it might be outside the public APIs. That said, here's an idea that might work, but I don't have all the details for you. The way you get Mail to open up when you want to send e-mail is that the APIs handle a URL request for mailto: by passing it to Mail. Maybe you can find another URL type that you can request to have opened, Mail will try to open it, but then have nothing there for Mail to open. If all goes in your favor, Mail will open and not show anything to the user (even an error from the bogus request you sent it).
Hell if I know what type of URL you'd need a pass, and there's no guarantee that something like this wouldn't break in a future iPhone OS version.