
C# // Create a MailMessage object. MailMessage msg = new MailMessage(); // Add a header. msg.Headers.Add("MyHeader", "Some value for my own header", false); VB.NET ' Create a MailMessage object. Dim msg As New MailMessage() ' Add a header. msg.Headers.Add("MyHeader", "Some value for my own header", False)
C# // Remove the non-standard headers from the message. msg.Headers.RemoveCustomHeaders(); VB.NET ' Remove the non-standard headers from the message. msg.Headers.RemoveCustomHeaders()
C# // Remove the specified header. msg.Headers.Remove("X-Special-Header"); // Remove the first header. msg.Headers.RemoveAt(0); VB.NET ' Remove the specified header. msg.Headers.Remove("X-Special-Header") ' Remove the first header. msg.Headers.RemoveAt(0)
Oracle发布了最新的企业可视化解决方案AutoVue系列产品v21.0.1版本。(21产品系列中的一个分支版本)。新版本包括了在不支持Java applet *的浏览器中使用AutoVue的能力,并为核心的CAD格式提供支持。
*由于浏览器的已知问题,不支持Microsoft Edge。
AutoVue系列产品包括:AutoVue 3D Professional Advanced、AutoVue Electro-Mechanical Professional、AutoVue EDA、AutoVue Office、AutoVue 2D Professional
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()C#: Smtp mailer = new Smtp(); VB.NET: Dim mailer As New Smtp()
C#:
mailer.SmtpServers.Add("mail.domain.com");
VB.NET:
mailer.SmtpServers.Add("mail.domain.com")mailer.SmtpServers.Add("mail.domain.com", "jdoe", "secret");
VB.NET:
mailer.SmtpServers.Add("mail.domain.com", "jdoe", "secret")C#:
mailer.Message.From.AsString = "jdoe@domain.com";
mailer.Message.To.AsString = "bill@domain.com";
mailer.Message.Subject = "Hi";
mailer.Message.BodyPlainText = "Hello Bill";
mailer.Message.From.AsString = "John Doe ";
mailer.Message.To.AsString = "Bill (Company Inc), Kathy ";
mailer.Message.Subject = "The document";
mailer.Message.BodyHtmlText = "The document body";
mailer.Message.From.Email = "jdoe@domain.com";
mailer.Message.From.DisplayName = "John Doe";
mailer.Message.To.AsString = "Kathy ";
mailer.Message.Cc.Add("bill@domain.com", "Bill Smith");
mailer.Message.Subject = "News";
mailer.Message.BodyPlainText = "News body";VB.NET:
mailer.Message.From.AsString = "jdoe@domain.com"
mailer.Message.To.AsString = "bill@domain.com"
mailer.Message.Subject = "Hi"
mailer.Message.BodyPlainText = "Hello Bill"
mailer.Message.From.AsString = "John Doe "
mailer.Message.To.AsString = "Bill (Company Inc), Kathy "
mailer.Message.Subject = "The document"
mailer.Message.BodyHtmlText = "The document body"
mailer.Message.From.Email = "jdoe@domain.com"
mailer.Message.From.DisplayName = "John Doe"
mailer.Message.To.AsString = "Kathy "
mailer.Message.Cc.Add("bill@domain.com", "Bill Smith")
mailer.Message.Subject = "News"
mailer.Message.BodyPlainText = "News body"C#: mailer.Send(); VB.NET: mailer.Send()
