Мне нужно иметь функциональность, в которой пользователи могут отправлять файлы (аудиофайлы) в виде вложений по электронной почте.
Я попытался использовать пространство имен Microsoft.Office.Interop.Outlook.Application
, но он открывает внешний вид и не работает, если Outlook не установлен на клиентском компьютере.
Я пробовал использовать классы SmtpClient()
и MailMessage()
пространства имен System.Net.Mail
, но не открывал почтовый клиент.
Его отправка почты через предопределенный сервер (может быть, проблема, поскольку я не знаю, что мой домен электронной почты по умолчанию для моего клиента. Эта ссылка имеет все, что мне нужно, и ее отлично работает.
Но там они использовали атрибут DllImport, и из этого метода может возникнуть множество проблем (из чего я могу понять). Я понятия не имею о управляемом и неуправляемом коде, поэтому я не могу понять, в чем проблема. Хорошо ли следовать примеру в приведенной выше ссылке. Если не так?
Можете ли вы рассказать или предоставить ссылки о том, как подойти к моей проблеме?