PowerTCP Mail for .NET
ReplyInline Method
Example 




Address to use for From.
Text to prepend to MailMessage.Text.
Text to separate textReply from the original MailMessage.Text.
HTML to prepend to MailMessage.Html.
Text/HTML to separate htmlReply from the original MailMessage.Html.
Creates a reply message by prepending the reply text/HTML and separators to the original text/HTML.
Syntax
Public Function ReplyInline( _
   ByVal from As String, _
   ByVal textReply As String, _
   ByVal textSeparator As String, _
   ByVal htmlReply As String, _
   ByVal htmlSeparator As String _
) As MailMessage
Dim instance As MailMessage
Dim from As String
Dim textReply As String
Dim textSeparator As String
Dim htmlReply As String
Dim htmlSeparator As String
Dim value As MailMessage
 
value = instance.ReplyInline(from, textReply, textSeparator, htmlReply, htmlSeparator)
public MailMessage ReplyInline( 
   string from,
   string textReply,
   string textSeparator,
   string htmlReply,
   string htmlSeparator
)
public: MailMessage* ReplyInline( 
   string* from,
   string* textReply,
   string* textSeparator,
   string* htmlReply,
   string* htmlSeparator
) 
public:
MailMessage^ ReplyInline( 
   String^ from,
   String^ textReply,
   String^ textSeparator,
   String^ htmlReply,
   String^ htmlSeparator
) 

Parameters

from
Address to use for From.
textReply
Text to prepend to MailMessage.Text.
textSeparator
Text to separate textReply from the original MailMessage.Text.
htmlReply
HTML to prepend to MailMessage.Html.
htmlSeparator
Text/HTML to separate htmlReply from the original MailMessage.Html.

Return Value

A MailMessage.
Exceptions
ExceptionDescription
System.FormatExceptionIndicates a from or to address is not properly formatted.
Remarks

Can be used to create a UI-centric reply message (use empty strings for textReply and htmlReply). To create a reply that leaves the original parts unmodified, use Reply.

The MailMessage is cloned and the 'textReply' and 'textSeparator' arguments are prepended to MailMessage.Text, separated by System.Environment.NewLine. If the original MailMessage.Html is populated, it is wrapped in a blockquote tag, and the 'htmlReply' and 'htmlSeparator' arguments are prepended to it, separated by line break tags. If the original MailMessage.Html is not populated, it is set to the 'htmlReply' and 'htmlSeparator' arguments, separated by line break tags (if they are specified). The new message is addressed to the "Reply-To" or "From:" header field found in the original message ("Reply-To" supersedes "From:). "Re: " is prepended to the Subject.

This method modifies the original message. Use ReplyAllInline to reply to all recipients. Use Forward to forward a message.

The returned message can be modified to change any default values.

Example
Demonstrates generating the common reply separator.
/// <summary>
/// Generates the common reply separator.
/// </summary>
/// <param name="message">The message that is being replied to.</param>
/// <returns>A reply separator that can be used for the *Separator arguments of MailMessage.ReplyInline() or ReplyAllInline().</returns>
public string GenerateReplySeparator(MailMessage message)
{
    return "On " + message.Date.ToString() + ", " + message.From + " wrote:";
}
''' <summary>
''' Generates the common reply separator.
''' </summary>
''' <param name="message">The message that is being replied to.</param>
''' <returns>A reply separator that can be used for the *Separator arguments of MailMessage.ReplyInline() or ReplyAllInline().</returns>
Public Function GenerateReplySeparator(ByVal message As MailMessage) As String
    Return "On " & message.Date.ToString() & ", " & message.From & " wrote:"
End Function
See Also

Reference

MailMessage Class
MailMessage Members


PowerTCP Mail for .NET Documentation Version 4.3
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic