小编Mor*_*sen的帖子

如何使用System.Net.Mail.SmtpClient在Xamarin中发送邮件

我正在尝试使用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)

c# email android smtpclient xamarin

0
推荐指数
1
解决办法
6671
查看次数

标签 统计

android ×1

c# ×1

email ×1

smtpclient ×1

xamarin ×1