Constructs an
CopyC#
EmailMessage
instance defining to and from addresses and subject and body of email.

Namespace: Jscape.Email
Assembly: Jscape.Email (in Jscape.Email.dll) Version: 2.4.5.0

Syntax

C#
public EmailMessage(
	string to,
	string from,
	string subject,
	string body
)
Visual Basic
Public Sub New ( _
	to As String, _
	from As String, _
	subject As String, _
	body As String _
)
Visual C++
public:
EmailMessage(
	String^ to, 
	String^ from, 
	String^ subject, 
	String^ body
)

Parameters

to
Type: System..::..String
The To: address.
from
Type: System..::..String
The From: address.
subject
Type: System..::..String
The subject of the email.
body
Type: System..::..String
The body of the email.

Remarks

Default headers, Date, MIME-Version, Message-ID, Content-Transfer-Encoding and Content-Type are added automatically.

Examples

This example creates an EmailMessage using the default us-ascii character set encoding for the To, From, and Subject properties."
CopyMime EmailMessage
String to = "to@theirserver.com";
String from = "me@myserver.com";
String subject = "Test subject";
String body = "Test message body.";
EmailMessage message = new EmailMessage(to, from, subject, body);

CopyMime EmailMessage
Dim to As String = "to@theirserver.com"
Dim from As String = "me@myserver.com"
Dim subject As String = "Test subject"
Dim body As String = "Test message body."
Dim message As EmailMessage = New EmailMessage(to, from, subject, body);

See Also