私はmailgunを使い始めたばかりです。しかし、私は、mailgun によって転送された電子メール メッセージを受信する C# MVC コントローラーを作成することを任されました。これを行うためのサンプル コードが mailgun によってリリースされたドキュメントで見ましたが、Django を使用しているため、あまり詳しくありません。Django で記述されたサンプル コードは次のとおりです。
def on_incoming_message(request):
if request.method == 'POST':
sender = request.POST.get('sender')
recipient = request.POST.get('recipient')
subject = request.POST.get('subject', '')
body_plain = request.POST.get('body-plain', '')
body_without_quotes = request.POST.get('stripped-text', '')
# note: other MIME headers are also posted here...
# attachments:
for key in request.FILES:
file = request.FILES[key]
# do something with the file
# Returned text is ignored but HTTP status code matters:
# Mailgun wants to see 2xx, otherwise it will make another attempt in 5 minutes
return HttpResponse('OK')
私の質問は、これを C# でどのように変換するのですか? サンプルコードは間違いなく素晴らしいでしょう。事前に助けてくれてありがとう。この質問がばかげていると思ったら申し訳ありません。