【发布时间】:2014-02-17 17:44:30
【问题描述】:
在我的 Windows Phone 7 应用程序中,我想发送一封电子邮件,其中邮件正文应包含我在应用程序中的上一页中的数据。以前我只是像这样集成电子邮件工具:
private void Image_Email(object sender, RoutedEventArgs e)
{
EmailComposeTask emailComposeTask = new EmailComposeTask();
emailComposeTask.Subject = "message subject";
emailComposeTask.Body = "message body";
emailComposeTask.To = "recipient@example.com";
emailComposeTask.Cc = "cc@example.com";
emailComposeTask.Bcc = "bcc@example.com";
emailComposeTask.Show();
}
但我无法在我的模拟器中进行测试。现在在body 部分,我想要上一页的数据。那么该怎么做呢?
更新代码:
if (this.NavigationContext.QueryString.ContainsKey("Date_Start"))
{
//if it is available, get parameter value
date = NavigationContext.QueryString["Date_Start"];
datee.Text = date;
}
if (this.NavigationContext.QueryString.ContainsKey("News_Title"))
{
//if it is available, get parameter value
ntitle = NavigationContext.QueryString["News_Title"];
title.Text = ntitle;
}
if (this.NavigationContext.QueryString.ContainsKey("News_Description"))
{
ndes = NavigationContext.QueryString["News_Description"];
description.Text = ndes;
}
现在我在消息正文中写什么?我无法测试它,因为我没有设备。 我可以传递这样的值吗:
emailComposeTask.Body = "title, ndes, date";
【问题讨论】:
标签: c# windows-phone-7