我正在尝试使用system.Net.Mail.SmtpClient发送和发送电子邮件到应用程序内部.当我在手机上运行代码时,我收到java.lang.runtimeexception错误,我无法弄清楚为什么?
我点击按钮时运行以下代码发送电子邮件.
using System;
using Android.App;
using Android.Widget;
using Android.OS;
using System.Net;
using System.Net.Mail;
using System.Net.Mime;
using System.Threading;
using System.ComponentModel;
namespace SendEmail
{
[Activity (Label = "SendEmail", MainLauncher = true)]
public class Activity1 : Activity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
// Set our view from the "main" layout resource
SetContentView (Resource.Layout.Main);
// Get our button from the layout resource,
// and attach an event to it
Button button = FindViewById<Button> (Resource.Id.myButton);
EditText Text = FindViewById<EditText> …Run Code Online (Sandbox Code Playgroud)