Sends simple message that does not allow any other parameters or properties to be set.
[Visual Basic]
Public Shared Function SendQuick( _
ByVal sToAddress As String, _
ByVal sFromAddress As String, _
ByVal sSubject As String, _
ByVal sBody As String _
) As ReturnCodes
An enumerated value of ReturnCodes
[C#]
public void Send()
{
ReturnCodes nRC = SmtpServer.SendQuick("to@email.com", "from@email.com", "Subject", "This is a test message");
if ( nRC != ReturnCodes.SUCCESS )
{
Console.Write("Error #"+nRC+" occurred.");
}
else
{
Console.Write(oSmtpDotNet.LogFileToString(false));
}
}
[VB]
Public Function Send() As Integer
Dim nRC As ReturnCodes
nRC = SmtpServer.SendQuick("to@email.com", "from@email.com", "Subject", "This is a test message");
If (nRC <> ReturnCodes.SUCCESS) Then
Console.Write("Error #"+nRC+" occurred.");
Else
' Success!
Console.WriteLine("Message Sent!")
End If
End Function
SmtpServer Class | SmtpServer Members | SmtpDotNet Namespace | ReturnCodes | Send