MailBee.NET Objects 4.0

MessageParserConfig.AHRefSuffix Property

Gets or sets a string which should be added to all <A HREF> tags as their attribute.

public string AHRefSuffix {get; set;}

Property Value

A string to be added to all <A HREF> tags as their attribute. The default value is an empty string (nothing gets added).

Remarks

This and AHRefCleanup properties are usually used together.

Note   MessageParserConfig object cannot be used on its own. To access its members, the developer should use MailMessage.Parser property.

Example

This sample loads the message from .EML file, removes Target attributes from all <A HREF> tags, and adds target=_blank instead. This will make all the links open in a new window.

[C#]
// To use the code below, import MailBee namespaces at the top of your code.
using MailBee;
using MailBee.Mime;

// The actual code (put it into a method of your class).
MailMessage msg = new MailMessage();
msg.LoadMessage(@"C:\Docs\TestMail.eml");
msg.Parser.AHRefCleanup = AHRefTagAttributes.Target;
msg.Parser.AHRefSuffix = "target=_blank";
msg.Parser.Apply();
[Visual Basic]
' To use the code below, import MailBee namespaces at the top of your code.
Imports MailBee
Imports MailBee.Mime

' The actual code (put it into a method of your class).
Dim msg As New MailMessage
msg.LoadMessage("C:\Docs\TestMail.eml")
msg.Parser.AHRefCleanup = AHRefTagAttributes.Target
msg.Parser.AHRefSuffix = "target=_blank"
msg.Parser.Apply()

See Also

MessageParserConfig Class | MailBee.Mime Namespace | AHRefCleanup