Windows Azure sending email via SMTP relay - azure

I have a site hosted on Windows Azure and currently I am using SendGrid to send emails. However, we have Mimecast as our email provider and it is marking all emails received from SendGrid as spam.
Is there a way to use Mimecast as the SMTP Relay service from my Windows Azure application?

Well,
Azure as such does not apply any restriction on the outgoing traffic (beside some bandwidth throttling based on the Size of the VM you are running on, but this quite generous). So in practice you can use any SMTP relay service.
Whether you can use Mimecast specifically, you shall turn to Mimecast support or products page. But there is nothing in Azure that would stop you from using this or that service (any service).
And Yes, you can use System.Net.Mail.SmtpClient or any other Smtp Client library to talk to external SMTP Service. Whether that external SMTP Service will accept your connection or not, is not subject to any kind of Azure limitation, but sole decision of the service you chose to use.

You should raise a ticket with SendGrid so they can manage this situation. The reason SendGrid is provided is to precisely avoid your mail being marked as spam. You will be unlikely to see any successful mail delivery if you route SMTP traffic directly from an Azure host to a receiving SMTP server.

Related

Integrate Azure Logic App with On Premises SMTP Relay for sending email

One of the actions in our Azure Logic App workflow is to notify the support group when there is an error in processing the rules.
We plan to integrate SMTP Relay which is running in on-Premise for this email notification requirement.
How to integrate that SMTP Relay with Logic App action for sending email for this use case?

Problems setting up NodeMailer with MailGun

I'm trying to set up NodeMailer v0.7 in an Azure App Service for my Ghost blog. No matter what I do, I cannot get it to send mail when the exact same configuration is working in another environment.
It keeps telling me Relaying Denied. I've written up an extensive troubleshooting support page on this if anyone would like to help me.
I would GREATLY appreciate any help you can provide.
https://www.notion.so/Azure-Web-App-Ghost-Blog-Email-Issue-ef9221fde09d47e29a211ea45357563e
On Azure App Service, for sending email, the recommended way is to use SendGrid or O365.
Due to some reason for SMTP, I think you can not directly use nodemailer to send mail on Azure WebApp, please see the blog Troubleshooting SMTP issues/Sending emails from Azure Web Apps from a MS Support Engineer to know, and the first Q & A explains your current issue, as below.
1. Are you using a Relay Service or are you trying to send email directly from the web application?
If you are not using a relay service to send email, you are in an
unsupported scenario within all of Azure (including running an
application in a VM or cloud service). To reduce the possibility of
customers using Azure resources to send SPAM emails we do not allow
sending email directly from any service in Azure. See the blog below.
Relay services include SendGrid, O365, other third-party relay
services, and customer’s own on-premises relay services. So first
verify if the customer is using a relay service. If they do not have a
relay service they must configure their application to use one, there
is no other workaround.
https://blogs.msdn.microsoft.com/mast/2017/11/15/enhanced-azure-security-for-sending-emails-november-2017-update/
If you consider to switch to SendGrid, #sendgrid/client can help you to easier send mail.

how to setup email functionality in azure environment [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Hi can any1 tell me how to implement email functionality in azure without using sendgrid or any other 3rd party all. Can we have service bus to connect azure and exchange server to send emails.is it possible.or do we have exchange server web services to be accesses in azure and sends
email
The problem is not about having to use a third party, it is about the security and firewall implications — particularly with corporate security overlords. An exchange server can have outgoing smtp (even with username and password) enabled, and it is easy for any application (including those running on Azure) to send outgoing SMTP. The problem that you will invariably run into is that the perimeter security around the exchange server will not allow smtp from a public ip address (hackers frequently scan for open port 25, so that they can relay spam through unsuspecting mail servers). Windows Azure (roles and websites) cannot use a fixed (outgoing) ip, so firewall rules cannot be created.
Your options are:
Setup a VPN with your corporate network, so your Azure instance will send from a private IP address.
Run a mail relay service on an Azure VM. The VM can have an infinite lease on an IP address, so won't change (much). There are simple and cheap mail transfer agent services that run on Linux.
Use any 'ol smtp server. If you're not sending much out, you could use Google or even outlook.com. Outlook.com allows you to configure accounts that are hosted elsewhere, so you should be able to use smtp with your windows live id (Microsoft account).
I would avoid writing complicated code and services that use something like service bus. System.Net.Mail should be used to send to an smtp server.
One thing I've seen done in the past was to have the Windows Azure app put a message on a queue, along with optionally some larger data (attachments, large body text, etc.) in a blob. That gets the data stored in Windows Azure storage. From there, an on-premises app (e.g. Windows Service) could pull the queue and blob data, construct an email message, and send it to the on-premises Exchange server.
If you need everything to be cloud-hosted, then I would think you should be able to connect your Windows Azure apps to an Exchange web service endpoint (assuming you can properly secure that and make the web service connection).

Enable IIS SMTP Service on Azure instances

Is it possible to enable IIS SMTP Service on Azure instances?
I had this very same conversation with someone at Microsoft just the other day.
Azure doesn't support the SMTP service because if it did, it would quickly become the world's biggest spamming engine and the Azure IP address range would soon be blacklisted.
The answer I was given is to relay through an on-premise or third-party SMTP relay service.
You might be able to achieve something with a VM Role, or maybe a different SMTP solution in a worker role, but for the reasons given above, I wouldn't bother.

Sending Email from centralized server with multiple web servers

I am building a ASP.NET MVC3 application that will be running on a couple web servers. Instead of each server/app sending its own emails(Asnyc) per request, I would like to leverage something like MSMQ and send messages to an email server that would pick up the messages and send an email.
I have an idea of how to do this with a console app, windows service and MSMQ but was looking for some direction from anyone who has had success/experience implementing something similar. Any guidance, experience, technology, blog posts would be appreciated.
From what I see you're simply after an e-mail relay service. You could just use a dedicated IIS to do this for you. IIS SMTP has builtin queued mail relay functionallity. Preferably you want to cluster this IIS SMTP service for max. reliability.
Regarding the consideration in the article linked I can't see the difference between the users page process waiting for sending a message to an SMTP server and sending a message to a MSMQ.
I believe when it come to redundancy you'll find it much easier to set up a clustered SMTP service than clustered MSMQ.

Resources