原創(chuàng)|使用教程|編輯:黃竹雯|2017-05-15 15:38:19.000|閱讀 476 次
概述:本文主要介紹了MailBee.NET Objects中發(fā)送發(fā)送帶有嵌入對(duì)象的電子郵件的代碼示例。歡迎您下載試用版進(jìn)行運(yùn)用!
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
C#: oMailer.BodyHtmlText = @"<DIV>Test HTML message.</DIV><BR><BR> <FONT face=""Arial Black"" color=#0000ff size=5> <P align=left><STRONG><U> This is a test HTML mes-sage. </U></STRONG></P></FONT><p> <hr size=1> <a href=""//www.afterlogic.com"">www.afterlogic.com</a>"; |
VB.NET: oMailer.BodyHtmlText = "<DIV>Test HTML message.</DIV><BR><BR>" & vbCrLf & _ "<FONT face= ""Arial Black"" color = #0000ff size = 5>" & vbCrLf & _ "<P align=left><STRONG><U>" & vbCrLf & _ "This is a test HTML mes-sage." & vbCrLf & _ "</U></STRONG></P></FONT><p>" & vbCrLf & _ "<hr size= 1>" & vbCrLf & _ "<a href= ""//www.afterlogic.com"">www.afterlogic.com</a>" |
C#: oMailer.Message.LoadBodyText(@"//www.domain.com/index.htm", MessageBodyType.Html); |
VB.NET: oMailer.Message.LoadBodyText("//www.domain.com/index.htm", MessageBodyType.Html) |
C#: oMailer.Message.LoadBodyText(@"C:\Temp\saved_web_page.htm", MessageBodyType.Html); |
VB.NET: oMailer.Message.LoadBodyText("C:\Temp\saved_web_page.htm", MessageBodyType.Html) |
C#: oMailer.Message.LoadBodyText(@"//www.domain.com/index.htm ", MessageBodyType.Html, Encoding.Default, ImportBodyOptions.ImportRelatedFiles| ImportBodyOptions.ImportRelatedFilesFromUris); |
VB.NET: oMailer.Message.LoadBodyText("//www.domain.com/index.htm ", _ MessageBodyType.Html, _ Encoding.Default, ImportBodyOptions.ImportRelatedFiles Or _ ImportBodyOptions.ImportRelatedFilesFromUris) |
C#:
using System;
using System.Text; using MailBee; using MailBee.SmtpMail; using MailBee.Mime; namespace EmailApp
{ class Class1 { [STAThread] static void Main(string[] args) { Smtp oMailer = new Smtp(); oMailer.To.AddFromString("Bill Smith <b.smith@domain.com>");
oMailer.From.AsString = "John Doe <j.doe@domain.com> (Company Info)";
oMailer.Subject = "Test web page";
oMailer.Message.LoadBodyText(@"//www.domain.com/index.htm", MessageBodyType.Html, Encoding.Default,
ImportBodyOptions.ImportRelatedFiles | ImportBodyOptions.ImportRelatedFilesFromUris);
try
{ oMailer.Send(); Console.WriteLine("The message has been successfully sent."); } catch (MailBeeSmtpMessageSizeOutOfRangeException e) { Console.WriteLine("The message is too large (more than " + e.MaxAllowedMessageSize + " bytes)."); } } } } |
VB.NET:
Imports System
Imports System.Text Imports MailBee Imports MailBee.SmtpMail Imports MailBee.Mime Namespace EmailApp Class Class1 <STAThread> _ Shared Sub Main(ByVal args() As String) Dim oMailer As Smtp = New Smtp() oMailer.To.AddFromString("Bill Smith <b.smith@domain.com>") oMailer.From.AsString = "John Doe <j.doe@domain.com> (Company Info)" oMailer.Subject = "Test web page" oMailer.Message.LoadBodyText("//www.domain.com/index.htm", MessageBodyType.Html, Encoding.Default, ImportBodyOptions.ImportRelatedFiles | ImportBodyOptions.ImportRelatedFilesFromUris)
Try oMailer.Send() Console.WriteLine("The message has been successfully sent.") Catch e As MailBeeSmtpMessageSizeOutOfRangeException Console.WriteLine("The message is too large (more than " + e.MaxAllowedMessageSize + " bytes).") End Try End Sub End Class End Namespace |
試用、下載、了解更多產(chǎn)品信息請(qǐng)點(diǎn)擊""
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn