Skip to content

Ghost Mail

Adrien Castex edited this page May 30, 2016 · 1 revision

Ghost Mail

  • Namespace : HarkLib.Net
  • File : HarkLib.Net.dll

Plan

Description

A ghost mail is a mail with custom headers.

Structure

Constructor(s)

Scope Method
public GhostMail()

Propertie(s)

Scope Get Set Type Name
public ✔️ ✔️ string DestinationEMail
public ✔️ ✔️ string DestinationUser
public ✔️ string DestinationHost
public ✔️ string SourceHost
public ✔️ ✔️ string SourceUser
public ✔️ ✔️ string SourceEMail
public ✔️ ✔️ string Subject
public ✔️ ✔️ string Content
public ✔️ ✔️ IPAddress DestinationIP
public ✔️ ✔️ int DestinationPort
public ✔️ ✔️ DateTime Date
public ✔️ ✔️ string ContentType
public ✔️ ✔️ Dictionary<string, string> Headers
public ✔️ ✔️ string this[string name]

Method(s)

Scope Method
protected int WaitForResultCode(Stream stream)
public string GetMessage()
public void Send()

Usage

GhostMail gm = new GhostMail();
gm.DestinationEMail = "[email protected]";
gm.DestinationUser = "Source User";
gm.SourceUser = "Dest User";
gm.SourceEMail = "[email protected]";
gm.Subject = "subject";
gm.Content = "content...";

gm.Send(); // Send the email

Or, with less redundant code :

GhostMail gm = new GhostMail()
{
    DestinationEMail = "[email protected]",
    DestinationUser = "Source User",
    SourceUser = "Dest User",
    SourceEMail = "[email protected]",
    Subject = "subject",
    Content = "content..."
};

gm.Send(); // Send the email

If you want to add new headers, you can use

gm.Headers.Add("CustomHeader", "CustomValue");
gm.Headers["CustomHeader"] = "CustomValue";
gm["CustomHeader"] = "CustomValue";

Dictionary<string, string> customHeaders = /* [...] */
gm.Headers.AddRange(customHeaders);

If you want to see what will be the result of the data part :

string data = gm.GetMessage();
Console.WriteLine(data);

Documentation


Classes

Clone this wiki locally