Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi!
Im Developing a WindowsPhone 7 App. i want to make a method in my program which sends email to a gmail account , i knew the coding for asp.net but as i m very new to wp7 so i dont knw how to send email from windows phone 7 plateform to gmail account, i m using silverlight app for wp7.can any 1 help me out ?
Posted

1 solution

You can use the EmailComposeTask to use one of the email accounts on the phone to send you an email. Keep in mind that this method means that the user will get to edit and then possibly not send the email, but it is one of the simplest ways.

C#
Microsoft.Phone.Tasks.EmailComposeTask emailComposeTask = new Microsoft.Phone.Tasks.EmailComposeTask();
 emailComposeTask.To = "tomail@localhost.com";
 emailComposeTask.Cc = "ccmail@localhost.com";
 emailComposeTask.Subject ="Your Subject here";
 emailComposeTask.Body = "Your mail content here";
 emailComposeTask.Show(); // Launches send mail screen


If you are looking to have the user not involved at all then I would suggest a web service online that would take the message you want to send and have it do it using something like ASP.NET like you already mentioned.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900