1

Using SmtpClient we can send mail but unfortunately SmtpClient is not available in UWP platform.

Is there any other solution available to send an Email to any domain (gmail, outlook, etc.) ?

Vijay
  • 78
  • 1
  • 10

2 Answers2

4

use follwing Code to send a Email:

        EmailMessage emailMessage = new EmailMessage();
        emailMessage.To.Add(new EmailRecipient("***@***.com"));
        emailMessage.Subject = "Aktueller Warenkorb von " + ApplicationView.GetForCurrentView().Title.ToString().Trim();
        string messageBody = "Hallo " + ApplicationView.GetForCurrentView().Title.ToString().Trim() + ",\r\n\r\nAnbei sende ich Ihnen eine PDF mit ihrem aktuellem Warenkorb.\r\n\r\n" +
            "Bei Fragen stehe ich ihnen gerne zur Verfügung.\r\n\r\n" +
            "Mit freundlichen Grüßen";
        emailMessage.Body = messageBody;

        await EmailManager.ShowComposeNewEmailAsync(emailMessage);
Hubii
  • 348
  • 1
  • 14
0

Create a new EmailMessage object and set the data that you want to be pre-populated in the compose email dialog. Call ShowComposeNewEmailAsync to show the dialog. This link may help you . https://learn.microsoft.com/en-us/windows/uwp/contacts-and-calendar/sending-email