Is EmailComposeTask Class already working? - windows-phone-7

For example here:
http://msdn.microsoft.com/en-us/library/ff769550(VS.92).asp
EmailComposeTask emailComposeTask = new EmailComposeTask();
emailComposeTask.To = "user#example.com";
emailComposeTask.Body = "Email message body";
emailComposeTask.Cc = "user2#example.com";
emailComposeTask.Subject = "Email subject";
emailComposeTask.Show();
I read it doesnt work yet.

I have a real device, and an application in the marketplace - it is definitely working. The reason it doesn't work on an emulator is that you can't set up an email account on the emulator, and the first step of the email compose task when it is run is to prompt the user to select which email account to send the email with (if you've got more than one)
Since you can't set one up on the emulator, it kicks back and you can't send an email.
The only way to test this (for now) is to debug on an actual WP7 device, but I can 100% guarantee this is working.
One thing to note about the email tasker is that you can't programmatically add attachments...yet.

Yes, it works on real devices (not on the emulator)

Just pasted your code into an app, deployed to a device and was presented with a choice of which of my email accounts I wanted to use for the email after which the email was prepared ready editing and sending.

Related

Send an email with xamarin essential

I use the following sample to sent a simple email.
https://learn.microsoft.com/en-us/xamarin/essentials/email?tabs=android
The first time when I run xamarin forms app and call the sent method the popup with apps for selection appeared.
I selected Viber for testing, nothing happened but now i can't undo this selection. Every time when i call the send mail the viber opened.
I tried to clear the app data from the settings and unistall-install the app again but i have the same problem.
How can i fix it ? Can i open a dialog with only email clients ?
Thanks !!
I replace Xamarin.Essential email implementation
var message = new EmailMessage
{
Subject = subject,
Body = body,
To = recipients
};
await Email.ComposeAsync(message);
with
Device.OpenUri(new Uri("mailto:test#test.com?subject=test&body=test"));
Now the dialog has only the available mail clients.

Is there a way to check for missed/unread notifications?

Is there an api in mango sdk that allows me to programatically poll the notifications/toast to at least get the count. I'd like to write background service check for missed messages.
It's not possible to get hold of the email/SMS messaging details like this in Windows Phone. The only way to interact with the email client is via the SDK Launchers and Choosers: see this link on MSDN.
About all you can do is call the EmailComposeTask or SmsComposeTask for writing a plain text email or SMS, or EmailAddressChooserTask for getting an email address from the address book.
Also bear in mind that launchers and choosers must be initiated by a user action and cannot be launched from any background agent code.

Sharing detail with email for windows mobile7

I am working on an application for windows mobile 7.
I need to send some information from my application to some user via email.
I am using "EmailComposeTask()" for this. But i am getting error "email cant send. make sure u have setup an accout"
How to setup an email account in windows7 emulator.
Can anyone help me?
Following code i am using ...
emailComposeTask = new EmailComposeTask();
emailComposeTask.Body = textBox1.Text;
emailComposeTask.To = textBox2.Text;
emailComposeTask.From=TextBox3.Text;
emailComposeTask.Show();
Thanks
The EmailComposeTask can't be used in the emulator.
Your code seems correct, it should work on a real device.

How to send email with an attachment using Windows Phone 7 API?

My WP7 application requirement is to send the email with an attachment and use device default SMTP settings.
I have tried EmailComposeTask class but it doesn't have any member for attachment.
The other idea, i am thinking is to upload the file on server and then send the email from that server.
What you think if there is no way to send the email with an attachment using WP7 API?
Your observation is correct, at this point in time EmailComposeTask doesn't support attachments and this is the only facility to send email programatically from the device at the moment.
As you note, you can communicate with a server which can perform this task on behalf of your app.
I found a wp7 and wp8 library that does it: http://www.windowsphonegeek.com/marketplace/components/livemailmessage
Try to create web service to send mail in your webserver. so, we can call the from your app to send mail.
I hope upcoming version it will be possible!
Please check this URL for more details http://forums.silverlight.net/forums/p/209808/493532.aspx
I've found this article, but I did not make any test yet.
From the author:
EmailComposeTask won’t allow you to send attachments, but this doesn’t mean that you cannot send files through it. .NET Framework has these two amazing methods: Convert.ToBase64String and Convert.FromBase64String. The first will allow the developer to convert a byte array (byte[]) to a Base64-encoded string, the other one will do the same operation in reverse.
Reference:
Pushing the Limits of the Windows Phone SDK and Sending Files via EmailComposeTask

Is it possible to send an e-mail using the VS2010 development server?

Is it possible to send an e-mail using the VS2010 development server? If that's possible, can someone point me to a sample the web?
I'd like to send an e-mail to the person who register so to keep a proof that we (yes or not) received his request. The e-mail will contains a few pertinent info, such as the name, time, and son on.
EDIT
At my work, we collect data and to whoever needs as long as the ministry we work for tells as to do so. After we receive the paper form, we write an e-mail to the form sender. Until now, we use a paper form to know who needs data. I'd like to put that form online and also be able to generate an e-mail to the sender of the request. So, since I'm still developing the application, I need to test how sending the e-mail will work. That's why I'm asking if I can send an e-mail, for instance, to my Yahoo account from my laptop using VS2008 web development server.
I remember, 2 years ago, while learning HTML with DreamWeaver, we where able to send e-mail and received them in our Yahoo e-mail accounts (without any special configuration).
Thanks for helping
The web server won't make a difference. Whether you can will depend on the environment your server is in.
The simplest option is to use .NET's built-in email classes. You're probably using .NET 3.5 so that's System.Net.Mail, e.g.
MailMessage message = new MailMessage()
{
From = new MailAddress("you#youraddress", "Your Name"),
Subject = "The subject",
Body = #"Simple text body; set IsBodyHtml for HTML"
};
message.To.Add(new MailAddress("first#recipient.address", "First recipient - can add more"));
SmtpClient smtpClient = new SmtpClient("your.smtp.server");
smtpClient.Send(message);
If you don't specify an SMTP server name in the constructor it will read it from web.config.
If you don't have access to an SMTP server but do have permission to use external web services then you could use something like http://postmarkapp.com/ - I've seen other questions about them here but haven't used them myself.
Not answering straight to the question, but:
If testing the emails sent when running on a development server is the purpose, a simple SMTP stub server like smtp4dev is a good alternative?

Resources