Dynamic Web TWAIN是一个专为Web应用程序设计的TWAIN扫描识别控件,本文给大家分享几个有关Dynamic Web TWAIN的常见问题,欢迎收藏!
慧都十四周年狂欢开启,Dynamic Web TWAIN终极让利7折特惠
限时一个月,马上咨询>>>
2017慧都十四周年狂欢搞事情!砸金蛋100%抽现金红包、满额豪送iPhone X、iPhone 8、DevExpress汉化免费送、团队升级培训套包劲省10万元......更多惊喜等您来探索!
【慧都十四周年庆预热开启!全场满额送七级豪礼,AppleMac笔记本电脑、iwatch、iPad等您来拿!】
活动时间:10月1日-10月31日
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)
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()