Reputation: 153
I have tried referencing system.net.mail in various frameworks:
framework: "net451"
dependency: "System.Net.Mail": "1.0.0-rc2-00001"
error: does not support framework
framework: "net46"
dependency: "System.Net.Mail": "1.0.0-rc2-00001"
error: does not support framework
framework: "dotnet5.4"
System.Net.Mail not available
framework: "dnx46"
System.Net.Mail not available
I have also tried using email package MailKit 1.2.21, installed from NuGet.
"net46": {
"dependencies": {
"MailKit": "1.2.21"
}
If I reference MailKit class, error: "The type of namespace cannot be found".
How do I send email in MVC 6?
Upvotes: 0
Views: 228
Reputation: 153
I have given up with the 3rd party libraryies. I created an Azure storage table, and the websites save their emails to this table. I have a Raspberry Pi in the server room which looks for new emails on the Azure table every 1 minute, pulls them off the table and sends them. There is a library for accessing Azure storage using Linux Python.
Also set up a 3G dongle on the PI and now can send SMS texts from my MVC6 websites as well!
This is far away from the solution I was looking for, but it works.
Upvotes: 1
Reputation: 38548
MailKit does not currently have an assembly specific to net46
, but there's no reason you couldn't use the net45
MailKit assembly.
Apparently nuget does not figure this out automatically for you and just reference the net45
assembly, so you'll have to do it manually.
I'll try to make the next MimeKit and MailKit release include net46
assemblies in the nuget package (which will probably just be net45
assemblies in the net46
directory in the nuget), but I'm holding off on making a new release until Microsoft releases dotnet 1.0 rc2.
I've been expecting this release every day for about a month now :(
Upvotes: 0