Complete integration of email and SMS delivery using Azure ASP.NET function app and the MessageFlow API.
If you are deploying MessageFlow through Azure Marketplace, you can find our Mix & Match - Email & SMS Communication offer here:
👉 MessageFlow – Mix & Match - Email & SMS Communication (See more here)
- MessageFlow account (Register here)
- API key with appropriate permissions (SMS, email)
- An Azure account with an active subscription.
- Visual Studio Code
- C# extension for Visual Studio Code.
- Azure Functions Core Tools
- Azure Functions extension for Visual Studio Code.
- The latest .NET 8.0 SDK
- Postman (for testing)
- Register: https://app.messageflow.com/register
- Confirm email and phone number
- Fill in company details and select services (SMS, Email)
- Navigate to the “Account”->“Settings”->“API” tab
- Click “New API Key”
- Name the key and set permissions, you need to select options “Transactional e-mail” and “Transactional SMS”
- Save the following values:
ApplicationKeyAuthorization
Keep your credentials secure — they will be needed in code!
If you received "Creating API keys impossible until account approved by customer service office" error it might be that your account has not yet been activated. If this process takes longer than 3 hours, please contact our support team to verify your identity.
To send emails we require two more things:
- domain in the FROM field must be verified. You can do this in “Email”->“Common settings”->“Senders authorization”. More information you can read here
- your personal "smtpAccount", you can get it from the MessageFlow application. Navigate to “Email”->“Email API”->“Settings”->“SMTP Accounts”
To send SMS messages, you need to add a sender ID. You can do this in “SMS”->“Common settings”->“Sender IDs”. More information you can read here
Repository: github.com/MessageFlow-Vercom/azure-dev
| Folder | Description |
|---|---|
AppService.* |
Web app for sending emails and SMS using the API |
Function.* |
Azure Functions handling HTTP requests and using AppService classes |
{
"RestApiApplicationKey": "your-app-key",
"RestApiAuthorization": "your-auth-key"
}
}You can copy the local.settings.example.json file, rename it to local.settings.json, and fill it in with your MessageFlow credentials.
- Go to: App Service → Configuration → Environment variables
- Add two variables:
RestApiApplicationKeyRestApiAuthorization
- Make sure you have .NET 8 SDK installed
- Configure
local.settings.jsonwith valid API keys - Go to project dir
- Run the function:
func start
Follow these steps to publish your project:
- Clone the repository and navigate to the selected directory
- Open Visual Studio Code from your project's root directory. If prompted, select Yes, I trust the authors.
- In Visual Studio Code, select View > Command Palette to open the Command Palette.
- Search for and select: Azure Functions: Create Function App in Azure.
Respond to the prompts as follows:
- If prompted, sign in to your Azure account.
- Select the Azure subscription to use. The prompt doesn't appear when you have only one subscription visible under Resources.
- Enter a globally unique name that's valid in a URL path. The name you enter is validated to make sure that it's unique in Azure Functions.
- Select an Azure region. For better performance, select a region near you.
- Select the runtime stack for your function app (select the language version you currently run locally, e.g., .NET 8 Isolated).
- Select resource authentication type. Select Managed identity, which is the most secure option for connecting to the default host storage account.
In the Azure: Activity Log panel, the Azure extension shows the status of individual resources as they're created in Azure.
- In Visual Studio Code, select View > Command Palette to open the Command Palette.
- Search for and select: Azure Functions: Deploy to Function App.
- Select the function app you just created. When prompted about overwriting previous deployments, select Deploy to deploy your function code to the new function app resource.
- When deployment is completed, select View Output to view the creation and deployment results, including the Azure resources that you created. If you miss the notification, select the bell icon in the lower-right corner to see it again.
Run the function in Azure
- In Visual Studio Code, select View > Command Palette to open the Command Palette.
- Search for and select: Azure Functions:Execute Function Now...
- Select recently deployed function
- Copy and paste payload
{
"subject": "Welcome to MessageFlow!",
"smtpAccount": "1.example.smtp",
"to": [
{
"email": "user1@example.com",
"name": "User 1"
},
{
"email": "user2@example.com",
"name": "User 2"
}
],
"cc": [
{
"email": "cc@example.com",
"name": "CC User"
}
],
"bcc": [
{
"email": "bcc@example.com",
"name": "BCC User"
}
],
"content": {
"html": "<h1>Hello!</h1><p>This is a test email from Azure.</p><p>Thanks for your attention!</p>",
"text": "Hello! This is a test email from Azure. Thanks for your attention!"
},
"from": {
"email": "from@example.com",
"name": "Azure Team"
},
"replyTo": {
"email": "reply@example.com",
"name": "Reply Handler"
},
"tags": ["azure", "messageflow", "test"],
"headers": {
"X-Custom-Header": "CustomValue",
"X-Priority": "High"
},
"globalVars": {
"company": "Messageflow",
"environment": "development"
}
}{
"sender": "senderName",
"message": "Azure test message from API",
"phoneNumbers": ["+48123456789", "+48987654321"],
"validity": 1,
"type": 0,
"externalId": "test-sms-001"
}- Method:
POST - URL:
https://your-function-url/api/MessageFlowEmailHttpTriggerhttps://your-function-url/api/MessageFlowSmsHttpTrigger
- Headers:
Content-Type: application/json
- Body:
- Choose
raw → JSON - Paste a sample payload
- Choose
[Client Request]
↓
[Azure]
↓
[AppService - Email / Sms]
↓
[MessageFlow API]
↓
[Client Response]
You can also copy the SmsService or EmailService file and use them in your code.
- Created by: MessageFlow
MessageFlow is a developer-friendly communication platform designed to help teams deliver secure, high-quality transactional messaging at scale.
With our Email & SMS API you can:
- Send fast, reliable transactional emails from any system
- Track delivery, errors and engagement in real time
- Improve deliverability with verified domains and optimized infrastructure
- Simplify integration with transparent pricing and predictable performance.