Open vsfeedback opened 3 years ago
I am having this same issue where attachments are not added but only when using outlook. Using the default email application works but this is not suitable in all situations as some companies restrict access to the default email application.
Same here... it gets added to Outlook if I am using the Share menu and select Outlook manually, however.
Same here, for UWP, Android and iOS.
Edit: on UWP, this could be the issue: https://stackoverflow.com/questions/33053358/sending-email-attachments-via-uwp-emailmanager-not-working and inside there's a workaround (building a .msg file and open it with the launcher)
Can confirm this for iPhone 6s/iOS 14 and iPhone 12 pro/iOS 15.
It fails exclusively when Outlook (and probably other third party clients as well) is set as the default Mail-program and fallen back to. I actually had to uninstall Mail for this to happen as it seems the API prefers the Mail app anyway.
As @MSicc observed using Outlook through the share API is never an issue.
I too am having problems testing the app with iOS 16.2
From my app I launch the mail with an attachment: ok with "Mail" but there is no attachment with "Gmail" or "Outlook"
I understand this by design(?).
If MFMailComposeViewController
is unable to be opened, it falls back to URL compose. I suppose a workaround might be to remove this fallback and force the user to use the regular Mail app.
Haven't tested this though.
Not sure if this is on Apple's side for allowing attachments through the Share API, but no third party Mail clients through other means but URL compose.
Can somebody from the project please process this ticket? So we can know whether there is a chance that something is done about this issue. But I don't think there is a chance, because I agree with @marwalsch after analyzing bug reports from our customers and looking at the code linked by him/her.
When this problem occurs, MFMailComposeViewController.canSendMail()
must have returned false because only a third party mail app is in use. Xamarin.Essentials tries a mailto URL which does not allow attachments. It also doesn't allow a mail body in HTML, trying to pass one throws a FeatureNotSupportedException
. I think it's a bug that the attachment is silently omitted instead of also throwing this exception.
This issue has been moved from a ticket on Developer Community.
I try to use Email.ComposeAsync from Xamarin Essentials to send an e-mail on a iOS phone. When I send an e-mail, although I attach an file using Atachment.Add() method, it is sent without the attachment.
Steps to reproduce:
What is expected to happen: e-mail to be sent with attachment
What happens: e-mail is sent without attachment
I have tried with both Outlook app and Gmail app on the iOS device with same result. Phone details: iPhone XS, OS version 14.6
================ NuGet packages used (all latest) ================ NETStandard.Library 2.0.3 Xamarin.Essentials 1.7.0 Xamarin.Forms 5.0.0.2083
================ contents of MainPage.xaml.cs ================ using System; using System.Collections.Generic; using System.ComponentModel; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using Xamarin.Essentials; using Xamarin.Forms;
namespace emailTest { public partial class MainPage : ContentPage { public MainPage() { InitializeComponent(); }
private void sendEmail_Clicked(object sender, EventArgs e) { EmailTest ET = new EmailTest(); ET. SendEmail("subject", "hello world", new List {"myemail.com"}); //I changed my e-mail so is not public
}
public class EmailTest { public async Task SendEmail(string subject, string body, List recipients)
{
try
{
var message = new EmailMessage
{
Subject = subject,
Body = body,
To = recipients,
//Cc = ccRecipients,
//Bcc = bccRecipients
};
//add attachment var fn = "Attachment.txt"; var file = Path.Combine(FileSystem.CacheDirectory, fn); File.WriteAllText(file, "Hello World"); message. Attachments.Add(new EmailAttachment(file));
//send email await Email.ComposeAsync(message); } catch (FeatureNotSupportedException fbsEx) { // Email is not supported on this device } catch (Exception ex) { // Some other exception occurred } } } } }
================ contents of MainPage.xaml ================ <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="emailTest.MainPage">
================ contents of Info.plist ================ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
================ System Info ================ Microsoft Visual Studio Community 2019 Version 16.9.4 VisualStudio.16.Release/16.9.4+31205.134 Microsoft .NET Framework Version 4.8.03752
Installed Version: Community
Visual C++ 2019 00435-60000-00000-AA776 Microsoft Visual C++ 2019
ASP.NET and Web Tools 2019 16.9.693.2781 ASP.NET and Web Tools 2019
Azure App Service Tools v3.0.0 16.9.693.2781 Azure App Service Tools v3.0.0
C# Tools 3.9.0-6.21160.10+59eedc33d35754759994155ea2f4e1012a9951e3 C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Extensibility Message Bus 1.2.6 (master@34d6af2) Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.
Graphical Debugging Extension 1.0 Graphical Debugging Visual Studio Extension allows to view graphical representation of variables, e.g. Boost.Geometry models or vectors of values.
HotReload Extension 1.4.0 Xamarin.Forms HotReload Visual Studio Extension
IntelliCode Extension 1.0 IntelliCode Visual Studio Extension Detailed Info
Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers
Microsoft Visual C++ Wizards 1.0 Microsoft Visual C++ Wizards
Microsoft Visual Studio VC Package 1.0 Microsoft Visual Studio VC Package
Mono Debugging for Visual Studio 16.9.7 (df23ba6) Support for debugging Mono processes with Visual Studio.
NuGet Package Manager 5.9.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
ProjectServicesPackage Extension 1.0 ProjectServicesPackage Visual Studio Extension Detailed Info
Test Adapter for Boost.Test 1.0 Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory.
Test Adapter for Google Test 1.0 Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory.
TypeScript Tools 16.0.30201.2001 TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools 3.9.0-6.21160.10+59eedc33d35754759994155ea2f4e1012a9951e3 Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual F# Tools 16.9.0-beta.21102.9+7ce7132f1459095e635194d09d6f73265352029a Microsoft Visual F# Tools
Visual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio
Visual Studio Tools for CMake 1.0 Visual Studio Tools for CMake
VisualStudio.DeviceLog 1.0 Information about my package
VisualStudio.Foo 1.0 Information about my package
VisualStudio.Mac 1.0 Mac Extension for Visual Studio
Xamarin 16.9.000.273 (d16-9@1bba9e0) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Designer 16.9.0.318 (remotes/origin/7b35adcdd1b204bbdcb279e0f029d151a20a4bf3@7b35adcdd) Visual Studio extension to enable Xamarin Designer tools in Visual Studio.
Xamarin Templates 16.9.72 (426ebf6) Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.
Xamarin.Android SDK 11.2.2.1 (d16-9/877f572) Xamarin.Android Reference Assemblies and MSBuild support. Mono: 5e9cb6d Java.Interop: xamarin/java.interop/d16-9@54f8c24 ProGuard: Guardsquare/proguard/v7.0.1@912d149 SQLite: xamarin/sqlite/3.34.1@daff8f4 Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-9@d210f11
Xamarin.iOS and Xamarin.Mac SDK 14.14.2.5 (3836759d4) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Original Comments
Feedback Bot on 7/14/2021, 07:35 PM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
Marius Rusu on 7/15/2021, 00:25 AM:
Just to be sure, I have checked and made sure that no exceptions are thrown while executing the code to send e-mail (as shown below in MainPage.xaml.cs).
Feedback Bot on 11/1/2021, 01:32 AM:
I detected that this issue hasn’t received a lot of activity, votes, or comments in the past 90 days. Based on this, the issues severity and affected area, it’s my experience that this issue is unlikely to get fixed. To improve the situation, consider following best practices for quality problem reports, and giving us more details on how this issue is impacting you.
Original Solutions
(no solutions)