📄 opensmtp.xml
字号:
EmailAddress from = new EmailAddress("support@OpenSmtp.com", "Support");
EmailAddress to = new EmailAddress("recipient@OpenSmtp.com", "Joe Smith");
MailMessage msg = new MailMessage(from, to);
</code>
</example>
</member>
<member name="M:OpenSmtp.Mail.MailMessage.#ctor(System.String,System.String)">
<summary>Constructor using string email addresses</summary>
<example>
<code>
MailMessage msg = new MailMessage("support@OpenSmtp.com", "recipient@OpenSmtp.com");
</code>
</example>
</member>
<member name="M:OpenSmtp.Mail.MailMessage.AddRecipient(OpenSmtp.Mail.EmailAddress,OpenSmtp.Mail.AddressType)">
<summary>Adds a recipient EmailAddress to the MailMessage</summary>
<param name="address">EmailAddress that you want to add to the MailMessage</param>
<param name="type">AddressType of the address</param>
<example>
<code>
MailMessage msg = new MailMessage("support@OpenSmtp.com", "recipient@OpenSmtp.com");
EmailAddress cc = new EmailAddress("cc@OpenSmtp.com");
msg.AddRecipient(cc, AddressType.Cc);
</code>
</example>
</member>
<member name="M:OpenSmtp.Mail.MailMessage.AddRecipient(System.String,OpenSmtp.Mail.AddressType)">
<summary>Adds a recipient RFC 822 formatted email address to the MailMessage</summary>
<param name="address">RFC 822 formatted email address that you want to add to the MailMessage</param>
<param name="type">AddressType of the email address</param>
<example>
<code>
MailMessage msg = new MailMessage("support@OpenSmtp.com", "recipient@OpenSmtp.com");
msg.AddRecipient("cc@OpenSmtp.com", AddressType.Cc);
</code>
</example>
</member>
<member name="M:OpenSmtp.Mail.MailMessage.AddAttachment(System.String)">
<summary>Adds an Attachment to the MailMessage using a file path</summary>
<param name="filepath">File path to the file you want to attach to the MailMessage</param>
<example>
<code>
MailMessage msg = new MailMessage("support@OpenSmtp.com", "recipient@OpenSmtp.com");
msg.AddAttachment(@"C:\file.jpg");
</code>
</example>
</member>
<member name="M:OpenSmtp.Mail.MailMessage.AddImage(System.String)">
<summary>Adds an included image to the MailMessage using a file path</summary>
<param name="filepath">File path to the file you want to attach to the MailMessage</param>
<example>
<code>
MailMessage msg = new MailMessage("support@OpenSmtp.com", "recipient@OpenSmtp.com");
msg.AddImage(@"C:\file.jpg");
</code>
</example>
</member>
<member name="M:OpenSmtp.Mail.MailMessage.NewCid">
<summary>
Generate a content id
</summary>
<returns></returns>
</member>
<member name="M:OpenSmtp.Mail.MailMessage.AddAttachment(OpenSmtp.Mail.Attachment)">
<summary>Adds an Attachment to the MailMessage using an Attachment instance</summary>
<param name="attachment">Attachment you want to attach to the MailMessage</param>
<example>
<code>
MailMessage msg = new MailMessage("support@OpenSmtp.com", "recipient@OpenSmtp.com");
Attachment att = new Attachment(@"C:\file.jpg");
msg.AddAttachment(att);
</code>
</example>
</member>
<member name="M:OpenSmtp.Mail.MailMessage.AddAttachment(System.IO.Stream)">
<summary>Adds an Attachment to the MailMessage using a provided Stream</summary>
<param name="stream">stream you want to attach to the MailMessage</param>
<example>
<code>
MailMessage msg = new MailMessage("support@OpenSmtp.com", "recipient@OpenSmtp.com");
Attachment att = new Attachment(new FileStream(@"C:\File.jpg", FileMode.Open, FileAccess.Read), "Test Name");
msg.AddAttachment(att);
</code>
</example>
</member>
<member name="M:OpenSmtp.Mail.MailMessage.AddCustomHeader(System.String,System.String)">
<summary>
Adds an custom header to the MailMessage.
NOTE: some SMTP servers will reject improper custom headers
</summary>
<param name="name">Name of the custom header</param>
<param name="body">Value of the custom header</param>
<example>
<code>
MailMessage msg = new MailMessage("support@OpenSmtp.com", "recipient@OpenSmtp.com");
msg.AddCustomHeader("X-Something", "HeaderValue");
</code>
</example>
</member>
<member name="M:OpenSmtp.Mail.MailMessage.AddCustomHeader(OpenSmtp.Mail.MailHeader)">
<summary>
Adds an custom header to the MailMessage.
NOTE: some SMTP servers will reject improper custom headers
</summary>
<param name="mailheader">MailHeader instance</param>
<example>
<code>
MailMessage msg = new MailMessage("support@OpenSmtp.com", "recipient@OpenSmtp.com");
MailHeader header = new MailHeader("X-Something", "HeaderValue");
msg.AddCustomHeader(header);
</code>
</example>
</member>
<member name="M:OpenSmtp.Mail.MailMessage.GetBodyFromFile(System.String)">
<summary>Populates the Body property of the MailMessage from a text file</summary>
<param name="filePath">Path to the file containing the MailMessage body</param>
<example>
<code>
MailMessage msg = new MailMessage("support@OpenSmtp.com", "recipient@OpenSmtp.com");
msg.GetBodyFromFile(@"C:\body.txt");
</code>
</example>
</member>
<member name="M:OpenSmtp.Mail.MailMessage.GetHtmlBodyFromFile(System.String)">
<summary>Populates the HtmlBody property of the MailMessage from a HTML file</summary>
<param name="filePath">Path to the file containing the MailMessage html body</param>
<example>
<code>
MailMessage msg = new MailMessage("support@OpenSmtp.com", "recipient@OpenSmtp.com");
msg.GetHtmlBodyFromFile(@"C:\htmlbody.html");
</code>
</example>
</member>
<member name="M:OpenSmtp.Mail.MailMessage.Reset">
<summary>Resets all of the MailMessage properties</summary>
<example>
<code>
MailMessage msg = new MailMessage("support@OpenSmtp.com", "recipient@OpenSmtp.com");
msg.Reset();
</code>
</example>
</member>
<member name="M:OpenSmtp.Mail.MailMessage.Save(System.String)">
<summary>Saves the MailMessage as a RFC 822 formatted message</summary>
<param name="filePath">Specifies the file path to save the message</param>
<example>
<code>
MailMessage msg = new MailMessage("support@OpenSmtp.com", recipient@OpenSmtp.com");
msg.Body = "body";
msg.Subject = "subject";
msg.Save(@"C:\email.txt");
</code>
</example>
</member>
<member name="M:OpenSmtp.Mail.MailMessage.ToString">
<summary>Returns the MailMessage as a RFC 822 formatted message</summary>
<example>
<code>
MailMessage msg = new MailMessage("support@OpenSmtp.com", "recipient@OpenSmtp.com");
msg.Body = "body";
msg.Subject = "subject";
string message = msg.ToString();
</code>
</example>
<returns>Mailmessage as RFC 822 formatted string</returns>
</member>
<member name="M:OpenSmtp.Mail.MailMessage.Copy">
<summary>Returns a clone of this message</summary>
<example>
<code>
MailMessage msg = new MailMessage("support@OpenSmtp.com", "recipient@OpenSmtp.com");
msg.Body = "body";
msg.Subject = "subject";
msg2 = msg.Copy();
</code>
</example>
<returns>Mailmessage</returns>
</member>
<member name="M:OpenSmtp.Mail.MailMessage.GetFileAsString(System.String)">
Internal/Private methods below
</member>
<member name="M:OpenSmtp.Mail.MailMessage.GetMessageBody">
<summary>
Determines the format of the message and adds the
appropriate mime containers.
This will return the html and/or text and/or
embedded images and/or attachments.
</summary>
<returns></returns>
</member>
<member name="M:OpenSmtp.Mail.MailMessage.GetInnerMessageBody">
<summary>
Get the html and/or text and/or images.
</summary>
<returns></returns>
</member>
<member name="P:OpenSmtp.Mail.MailMessage.ReplyTo">
<value>Stores the EmailAddress to Reply-To.
If no EmailAddress is specified the From address is used.</value>
</member>
<member name="P:OpenSmtp.Mail.MailMessage.From">
<value>Stores the EmailAddress of the sender</value>
</member>
<member name="P:OpenSmtp.Mail.MailMessage.To">
<value>Stores the EmailAddress of the recipient</value>
</member>
<member name="P:OpenSmtp.Mail.MailMessage.Subject">
<value>Stores the subject of the MailMessage</value>
</member>
<member name="P:OpenSmtp.Mail.MailMessage.Body">
<value>Stores the text body of the MailMessage</value>
</member>
<member name="P:OpenSmtp.Mail.MailMessage.HtmlBody">
<value>Stores the HTML body of the MailMessage</value>
</member>
<member name="P:OpenSmtp.Mail.MailMessage.Priority">
<value>Stores Mail Priority value</value>
<seealso>MailPriority</seealso>
</member>
<member name="P:OpenSmtp.Mail.MailMessage.Notification">
<value>Stores the Read Confirmation Reciept</value>
</member>
<member name="P:OpenSmtp.Mail.MailMessage.CC">
<value>Stores an ArrayList of CC EmailAddresses</value>
</member>
<member name="P:OpenSmtp.Mail.MailMessage.BCC">
<value>Stores an ArrayList of BCC EmailAddresses</value>
</member>
<member name="P:OpenSmtp.Mail.MailMessage.Charset">
<value>Stores the character set of the MailMessage</value>
</member>
<member name="P:OpenSmtp.Mail.MailMessage.Attachments">
<value>Stores a list of Attachments</value>
</member>
<member name="P:OpenSmtp.Mail.MailMessage.CustomHeaders">
<value>Stores a NameValueCollection of custom headers</value>
</member>
<member name="P:OpenSmtp.Mail.MailMessage.AltBoundary">
<value>Stores the string boundary used between MIME parts</value>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -