I have only the email but I don’t know how to extract the name, lastname and phone.
I don’t find the method that I need to use for. What should I try? Thank you. I am using imap.gmail.com
public static string ExtraerEmail(MimeMessage message)
{
try
{
var toAddress = message.To.Mailboxes.FirstOrDefault();
return toAddress?.Address ?? throw new Exception(“No se encontró el destinatario en la cadena.”);
}
catch (Exception)
{
return null;
}
}