-1

I'm working with windows phone 8 application I need to send HTML contents using Email compose task, Any one can help me?.

Sivakumar
  • 345
  • 4
  • 14

2 Answers2

1

As you can read here, you cannot use html formating using EmailComposeTask. To do that you will need to use a third party library line MailMessage or create a web service to send the mail from the web service.

Benoit Catherinet
  • 3,335
  • 1
  • 13
  • 12
1

As previously mentioned, you can't send HTML with EmailComposeTask. But you can do it with SendGridPlus, which I just released yesterday. Using their Web transport protocol, you can send Text & Html emails, with attachments. All you need is a free SendGrid account, which lets you send 200 emails/day.

Open up NuGet Package Manager (make sure you have the latest version of NuGet installed) and type install-package SendGridPlus -pre. Then, you can use the following code:

            var mail = Mail.GetInstance();
            mail.From = new MailAddress("someone@stackoverflow.com");
            mail.AddTo("you@thispost.com");
            mail.Subject = "Emails from Windows Phone!";
            mail.Html = "<b>Isn't this cool?!?</b>;
            var credentials = new NetworkCredential(sg_UserName, sg_Password);
            var sendGrid = Web.GetInstance(credentials);
            sendGrid.Deliver(mail);

HTH!

Robert McLaws
  • 2,258
  • 2
  • 19
  • 22