Skip to content

Instantly share code, notes, and snippets.

@BlitzkriegSoftware
Created February 4, 2019 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BlitzkriegSoftware/ad28452a45966500f9b4ab7038ca08b6 to your computer and use it in GitHub Desktop.
Save BlitzkriegSoftware/ad28452a45966500f9b4ab7038ca08b6 to your computer and use it in GitHub Desktop.
Support Class for sending e-mail in .NET Core 2.1+
using System;
using System.Collections.Generic;
using System.Text;
namespace testemail
{
public class EmailDTO
{
public string address { get; set; }
public string port { get; set; }
public int portNumber { get
{
if (!int.TryParse(this.port, out int pn)) pn = 25;
return pn;
}
}
public string username { get; set; }
public string password { get; set; }
public string subject { get; set; }
public string body { get; set; }
public string to { get; set; }
public string[] tolist
{
get
{
return this.to.Split(new char[] { ';' });
}
}
public string cc { get; set; }
public string[] cclist
{
get
{
return this.cc.Split(new char[] { ';' });
}
}
public string from { get; set; }
public string replyto { get; set; }
public IEnumerable<string> replytolist
{
get
{
return this.replyto.Split(new char[] { ';' });
}
}
public int howmany { get; set; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment