ina c# project i have a static async task written to send emails via tmpt-relay. the main function is calling this task. This is working fine. My Problem is i'm calling this function from a vb.net project, this is also working, email was send but vb.net is hanging in the c#-call
My Code in c#
public class SmoffMail
{
public static string sRet;
public string sendMail(string mailto)
{
RunAsync(mailto).Wait();
return sRet;
}
static async Task RunAsync(string mailto){
MailjetClient client = new MailjetClient("419cce0b9807d1016642156966fc4ec1",
....
sRet = "ok.....";
}
}
From the vb.net i call it like this:
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim smail As New smoff.Mailjet.SmoffMail
Dim i As Integer = 0
Dim sRet As String = ""
sRet = smail.sendMail("[email protected]")
MsgBox(sRet)
End Sub
End Class
So the function smail.sendMail() was called but is hanging, the next line in code ( msgbox ) is nerver attempt.
Thanks for your help
i found the solution, the problem was not my code, it was the API Mailjet.client. after changing the call to this API it works fine