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

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

Related

Can we send file as an attachment along with message in teams programmatically?

Can we send file as an attachment along with message in teams using webhooks or api?
Currently we can send only text message using webhooks and not attach files.
I want to mimic the action in the screenshot below:-
Attach file present in the system
There are ways to first upload file to one drive and then send its link in the teams message but I do not want to use that solution.
Is there a way to directly upload file from your system as an attachment to the microsoft teams using webhook or any alternative way.
Thanks!!
Currently it is not supported to send attachments using webhook. You will need to use bot to send and receive attachments. You can refer this link.
https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/bots-filesv4

How to send an e-mail from Windows Phone without using EmailComposeTask?

I need my application to send an e-mail to me directly without using the EmailComposeTask.
I also don't want to use a webservice for that.
Is there any open-source framework I could use?
There is currently not a way to send email w/o user input unless you want to send some information to a service and have the service send the email

Sending attachments in Windows Phone

I have been reading through the forums that it is not possible to send attachments through emails in Windows phone. Is this accurate? Is creating a web service my only option?
Any suggestions?
Thanks
Jai
Unfortunatly, the current SDK (7.1.1) doesn't allow us to send email messages with attachments; all you can send is text!
The only way is to get the file content (byte array) you want to send, encode it to Base64, and just set the message text to this enconded content...

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.

Simulating an attachment in the emailtask

In phone7 development, being able to send an email requires the use of the email task. This object doesn't not have an attachments property, and many ppl on various forums have complained about this particular lack of functionality. The problem is that Microsoft applications such as the picture gallery and OneNote have the ability to attach images and sound recordings to emails. This implies that there is a way to attach them.
Question: Is there a "hack" or other method that can be used to send emails with attachments in phone7?
No, there is no way to send attachments via the EmailComposeTask in a third party app. If you don't want to use an EmailComposeTask, you could create a server that runs a webservice which performs the sending of the email. Your app could then upload the attachment to that webservice.

Resources