【慧都十四周年庆预热开启!全场满额送七级豪礼,AppleMac笔记本电脑、iwatch、iPad等您来拿!】
活动时间:10月1日-10月30日
| C#: SmtpServer smtp_srv = new SmtpServer(); smtp_srv.Name = "mail.domain.com"; oMailer.SmtpServers.Add(smtp_srv); |
| VB.NET: Dim smtp_srv As SmtpServer = New SmtpServer() smtp_srv.Name = "mail.domain.com" smtp_srv.AccountName = "john_doe" smtp_srv.Password = "secret" oMailer.SmtpServers.Add(smtp_srv) |
| C#: oMailer.SmtpServers.Add("127.0.0.1"); |
| VB.NET: oMailer.SmtpServers.Add("127.0.0.1") oMailer.SmtpServers.Add("smtp.company.com") |
| C#: oMailer.SmtpServers.Add("127.0.0.1", 33, 1); |
| VB.NET: oMailer.SmtpServers.Add("127.0.0.1", 33, 1) oMailer.SmtpServers.Add("smtp.company.com", 37, 2) |
| C#: oMailer.SmtpServers.Add("127.0.0.1", "dan_brown", "password"); |
| VB.NET: oMailer.SmtpServers.Add("127.0.0.1", "dan_brown", "password") oMailer.SmtpServers.Add("smtp.company.com ", "john_doe", "secret") |
试用、下载、了解更多产品信息请点击"咨询在线客服"
C#
// Create SMTP object
Smtp mailer = new Smtp();
// Set the message fields.
mailer.From.AsString = "jdoe@domain.com";
mailer.To.AsString = "bill@domain2.com";
mailer.Subject = "Hi";
mailer.BodyPlainText = "This is test message";
// Starts logging SMTP activities into a file.
mailer.Log.Enabled = true;
mailer.Log.Filename = @"C:\log.txt";
mailer.Log.Clear();
// Specify the server to use. If your server does not require authentication,
// just omit both last parameters.
mailer.SmtpServers.Add("mail.domain.com", "jdoe", "secret");
// Attempt to connect.
mailer.Connect();
// Display the host name of the server the connection was established with.
Console.WriteLine("Connected to " + mailer.SmtpServers[mailer.GetCurrentSmtpServerIndex()].Name);
// Make sure all the recipients are ok.
if (mailer.TestSend(SendFailureThreshold.AllRecipientsFailed) != TestSendResult.OK)
{
Console.WriteLine("No recipients can receive the message.");
}// Show refused recipients if any
else if (mailer.GetRefusedRecipients().Count > 0)
{
Console.WriteLine("The following recipients failed: " + mailer.GetRefusedRecipients().ToString());
}
else
{
Console.WriteLine("All recipients are ok. Will send the message now.");
// Send e-mail. If it cannot be delivered, bounce will
// arrive to bounce@domain3.com, not to joe@domain1.com
mailer.Send("bounce@domain.com", (string)null);
Console.WriteLine("Sent to: " + mailer.GetAcceptedRecipients().ToString());
}
// Disconnect from the server
mailer.Disconnect();VB.NET
' Create SMTP object
Dim mailer As New Smtp
' Set the message fields.
mailer.From.AsString = "jdoe@domain.com"
mailer.To.AsString = "bill@domain2.com"
mailer.Subject = "Hi"
mailer.BodyPlainText = "This is test message"
' Starts logging SMTP activities into a file.
mailer.Log.Enabled = True
mailer.Log.Filename = "C:\log.txt"
mailer.Log.Clear()
' Specify the server to use. If your server does not require authentication,
' just remove last 2 parameters.
mailer.SmtpServers.Add("mail.domain.com", "jdoe", "secret")
' Attempt to connect.
mailer.Connect()
' Display the host name of the server the connection was established with.
Console.WriteLine("Connected to " + mailer.SmtpServers(mailer.GetCurrentSmtpServerIndex()).Name)
' Make sure all the recipients are ok.
If mailer.TestSend(SendFailureThreshold.AllRecipientsFailed) <> TestSendResult.OK Then
Console.WriteLine("No recipients can receive the message.")
Else
' Show refused recipients if any
If mailer.GetRefusedRecipients().Count > 0 Then
Console.WriteLine("The following recipients failed: " & mailer.GetRefusedRecipients().ToString())
Else
Console.WriteLine("All recipients are ok. Will send the message now.")
' Send e-mail. If it cannot be delivered, bounce will
' arrive to bounce@domain3.com, not to joe@domain1.com
mailer.Send("bounce@domain.com", CType(Nothing, String))
Console.WriteLine("Sent to: " + mailer.GetAcceptedRecipients().ToString())
End If
End If
' Disconnect from the server
mailer.Disconnect()[PresentationContext(DicomUidType.VideoPhotographicImageStorage, DicomUidType.ImplicitVRLittleEndian,
DicomUidType.JPEG2000,
DicomUidType.JPEG2000LosslessOnly,
DicomUidType.JPEGBaseline1,
DicomUidType.JPEGExtended2_4,
DicomUidType.ExplicitVRBigEndian,
DicomUidType.ExplicitVRLittleEndian,
DicomUidType.JPEGLosslessNonhier14,
DicomUidType.JPEGLosslessNonhier14B,
DicomUidType.Mpeg4AvcH264BdCompatibleHighProfileLevel_4_1,
DicomUidType.Mpeg4AvcH264HighProfileLevel4_1)]
[PresentationContext(DicomUidType.VideoPhotographicImageStorage, DicomUidType.ImplicitVRLittleEndian,
DicomUidType.JPEG2000,
DicomUidType.JPEG2000LosslessOnly,
DicomUidType.JPEGBaseline1,
DicomUidType.JPEGExtended2_4,
DicomUidType.ExplicitVRBigEndian,
DicomUidType.ExplicitVRLittleEndian,
DicomUidType.JPEGLosslessNonhier14,
DicomUidType.JPEGLosslessNonhier14B,
DicomUidType.Mpeg4AvcH264BdCompatibleHighProfileLevel_4_1,
DicomUidType.Mpeg4AvcH264HighProfileLevel4_1,
DicomUidType.MPEG2MainProfileHighLevel,
DicomUidType.MPEG2MainProfileMainLevel)]
试用、下载、了解更多产品信息请点击"咨询在线客服"
