尝试使用EmailMessageBuilder
中的Xamarin.Form (android and IOS)
发送带有附件的电子邮件。
没有给出错误,只是:
无法附加文件
按“发送电子邮件”时。
private void Notification_Clicked(object sender, EventArgs e)
{
var emailMessenger = CrossMessaging.Current.EmailMessenger;
if (emailMessenger.CanSendEmail)
{
var email = new EmailMessageBuilder()
.To("to.plugins@xamarin.com")
.Cc("cc.plugins@xamarin.com")
.Bcc(new[]{ "bcc1.plugins@xamarin.com",
"bcc2.plugins@xamarin.com" })
.Subject("Xamarin Messaging Plugin")
.Body("Testing 123")
.WithAttachment("<C:/Users/L30902/Desktop/hyphenApp(21-10-2018)/hyphenApp/hyphenApp/hyphenApp.Android/Resources/drawable/app_logo.png>", "image/png")
.Build();
emailMessenger.SendEmail(email);
}
}