How do I send an email from a Windows Phone 8 application?

前端 未结 6 2116
忘了有多久
忘了有多久 2020-12-16 15:38

In a Windows Forms project, I used the SmtpClient and MailMessage class in order to send information by email.

Is there an equivalent for Windows Phone 8?

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-16 16:14

    You can use Microsoft.Phone.Tasks.EmailComposeTask to compose an e-mail using the inbuilt mail client:

      var task = new EmailComposeTask {To = email};
      task.Show();
    

    Alternately you can post data to a 3rd party service, such as SendGrid to send the e-mail via an API.

    There are no SMTP APIs available on Windows Phone.

提交回复
热议问题