Send HTML Content Via EmailComposeTask [closed]

余生颓废 提交于 2019-12-13 07:52:47

问题


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


回答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.




回答2:


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!



来源:https://stackoverflow.com/questions/19030764/send-html-content-via-emailcomposetask

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!