Tx JP - good to see you back on the case I also think the .net mail solution will be better - it's just that I'd got hold of some example code (same as in your first link) and thought that was the way to do it
Any suggestions for example code on simple system.mail smtp send ? John Murray -----Original Message----- From: monodroid-boun...@lists.ximian.com [mailto:monodroid-boun...@lists.ximian.com] On Behalf Of Jonathan Pryor Sent: 18 July 2011 17:19 To: j...@murray.gb.com; Discussions related to Mono for Android Subject: Re: [mono-android] dumb question on Java Mail On Jul 18, 2011, at 11:42 AM, John Murray wrote: > how to I get a ref to the Java mail libraries? >From a cursory googling, it looks like javax.mail is provided by activation-1.1.jar and mail-1.4.jar from Sun [0], neither of which has been bound for use by Mono for Android. For now, the simplest thing to do would be to keep the code as Java, and bundle the Java source and Java libraries into your Mono for Android app using the AndroidJavaSource build action [1]. That said, it would probably be easier to skip the Java code and just use System.Net.Mail [2], as that'll be more portable to other platforms. > I am having trouble getting a reference in Visual studio - I've downloaded > Javamail1.4.4 but all I see is a set of folders with 'jar' files in them - > shouldn't there be some dll's I have to reference inVS2010 ? Sorry to be so > dumb here I just don't understand how all this works - I'm obviously not > doing the right thing installing Java mail - Any clues on this gratefully > appreciated When you need to reference a .jar file, you would select the .jar file and set it's Build Action to AndroidJavaSource, and that will include the .jar into your app. However, that won't permit easily using the .jar file from managed code; to do that, you either need a "binding" (tooling for which doesn't currently exist), or you need to deal with the types in the .jar file by hand with JNI [3]. Again, for sending email messages I would suggest using System.Net.Mail. - Jon [0] http://davanum.wordpress.com/2007/12/22/android-send-email-via-gmail-actuall y-via-smtp/ [1] http://android.xamarin.com/Documentation/Build_Process#Java_Interop_Support [2] http://msdn.microsoft.com/en-us/library/system.net.mail.aspx [3] http://android.xamarin.com/Documentation/API_Design#Jave_Native_Interface_Su pport _______________________________________________ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid _______________________________________________ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid