This question is locked. New answers and comments are not allowed.
Hey Guy
My problem is that outlook express 2010 cannot view the html documents which i compose using the RichTextEditor. This started after i upgraded from Silverlight 4 to 5 and because of that i had to upgrade telerik radcontrols as well.
I use the RichTextEditor to create the html body of my email and then send it off. The email is interpreted by Thunderbird, ms outlook 2007, gmail, etc. But not MS Outlook 2010!!
I kinda narrowed it down the the css. Just after the html body is generated. i manually strip the css from the html <head> and then send it off and then outlook can view the message. Also if i view the message in Text only mode then it also displays in the email client.
i have came across this article and tried to implement it, but i dont think this is what i must do to rectify my problem : http://www.telerik.com/help/silverlight/radrichtextbox-features-import-export-settings.html
I have not implemented this in the code example!
Here is my xaml
model layer functions
as you can see i dont do much more than take the html from the rich text editor and then storing onto a file system and then adding the record to the database. where it sits in a queue of to be send items.
My problem is that outlook express 2010 cannot view the html documents which i compose using the RichTextEditor. This started after i upgraded from Silverlight 4 to 5 and because of that i had to upgrade telerik radcontrols as well.
I use the RichTextEditor to create the html body of my email and then send it off. The email is interpreted by Thunderbird, ms outlook 2007, gmail, etc. But not MS Outlook 2010!!
I kinda narrowed it down the the css. Just after the html body is generated. i manually strip the css from the html <head> and then send it off and then outlook can view the message. Also if i view the message in Text only mode then it also displays in the email client.
i have came across this article and tried to implement it, but i dont think this is what i must do to rectify my problem : http://www.telerik.com/help/silverlight/radrichtextbox-features-import-export-settings.html
I have not implemented this in the code example!
Here is my xaml
<
UserControl
x:Class
=
"EvriOffice.Modules.MailModule.Views.OutgoingMessageView"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:iControls
=
"clr-namespace:EvriOffice.Infrastructure.Controls;assembly=EvriOffice.Infrastructure"
xmlns:pControls
=
"clr-namespace:EvriOffice.Infrastructure.Presentation.Controls;assembly=EvriOffice.Infrastructure.Presentation"
mc:Ignorable
=
"d"
d:DesignHeight
=
"800"
d:DesignWidth
=
"600"
AllowDrop
=
"True"
Drop
=
"UserControl_Drop"
>
<
Grid
x:Name
=
"LayoutRoot"
Background
=
"White"
Margin
=
"10, 0, 10, 10"
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"Auto"
/>
<
ColumnDefinition
Width
=
"*"
/>
</
Grid.ColumnDefinitions
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"Auto"
/>
<!--row 0 -->
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
Height
=
"*"
/>
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
Height
=
"Auto"
/>
</
Grid.RowDefinitions
>
<
StackPanel
Orientation
=
"Horizontal"
Grid.ColumnSpan
=
"2"
>
<
Image
x:Name
=
"imgTitle"
Height
=
"24"
VerticalAlignment
=
"Center"
/>
<
TextBlock
Grid.Row
=
"0"
x:Name
=
"tbTitle"
Margin
=
"5,0,10,10"
Style
=
"{StaticResource ModuleHeading}"
>Title</
TextBlock
>
</
StackPanel
>
<
sdk:Label
Grid.Row
=
"1"
Content
=
"Account:"
Background
=
"White"
HorizontalContentAlignment
=
"Center"
/>
<
ComboBox
DisplayMemberPath
=
"Name"
x:Name
=
"cboAccounts"
Grid.Column
=
"2"
Grid.Row
=
"1"
/>
<
Button
x:Name
=
"btnTo"
HorizontalContentAlignment
=
"Center"
Content
=
"xTo:"
Grid.Row
=
"2"
/>
<
Button
x:Name
=
"btnCc"
HorizontalContentAlignment
=
"Center"
Content
=
"xCc:"
Grid.Row
=
"3"
Grid.RowSpan
=
"1"
/>
<
Button
x:Name
=
"btnBcc"
HorizontalContentAlignment
=
"Center"
Content
=
"xBcc:"
Grid.Row
=
"4"
Grid.RowSpan
=
"1"
/>
<
TextBox
x:Name
=
"txtCc"
Grid.Column
=
"1"
Grid.Row
=
"3"
Grid.RowSpan
=
"1"
/>
<
TextBox
x:Name
=
"txtBcc"
Grid.Column
=
"1"
Grid.Row
=
"4"
Grid.RowSpan
=
"1"
/>
<
TextBox
x:Name
=
"txtTo"
Grid.Column
=
"1"
Grid.Row
=
"2"
/>
<
Grid
Grid.Row
=
"5"
Grid.ColumnSpan
=
"2"
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"Auto"
/>
<
ColumnDefinition
Width
=
"*"
/>
<
ColumnDefinition
Width
=
"Auto"
/>
</
Grid.ColumnDefinitions
>
<
sdk:Label
Background
=
"White"
Content
=
"Subject:"
HorizontalContentAlignment
=
"Center"
Name
=
"label4"
Grid.Column
=
"0"
/>
<
TextBox
x:Name
=
"txtSubject"
Grid.Column
=
"1"
/>
<
StackPanel
Grid.Column
=
"2"
Background
=
"White"
Orientation
=
"Horizontal"
>
<
sdk:Label
Background
=
"White"
Content
=
"Priority"
/>
<
ComboBox
x:Name
=
"cboPriority"
/>
<
sdk:Label
Background
=
"White"
Content
=
"Sensitivity"
/>
<
ComboBox
x:Name
=
"cboSensitivity"
/>
</
StackPanel
>
</
Grid
>
<
pControls:RichTextEditor
x:Name
=
"htmlProvider"
Grid.ColumnSpan
=
"2"
Grid.Row
=
"6"
/>
<
StackPanel
Grid.ColumnSpan
=
"2"
Grid.Row
=
"7"
x:Name
=
"stackAttachments"
>
<
TextBlock
Text
=
"Attachments:"
/>
<
ListBox
x:Name
=
"lstAttachments"
SelectionMode
=
"Multiple"
>
<
ListBox.ItemsPanel
>
<
ItemsPanelTemplate
>
<
StackPanel
Orientation
=
"Horizontal"
/>
</
ItemsPanelTemplate
>
</
ListBox.ItemsPanel
>
</
ListBox
>
</
StackPanel
>
<
Grid
Grid.ColumnSpan
=
"2"
Grid.Row
=
"8"
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"Auto"
/>
<
ColumnDefinition
Width
=
"*"
/>
<
ColumnDefinition
Width
=
"Auto"
/>
</
Grid.ColumnDefinitions
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
Height
=
"Auto"
/>
</
Grid.RowDefinitions
>
<
ContentControl
x:Name
=
"cntChooseDocumentTemplate"
Visibility
=
"Collapsed"
Grid.ColumnSpan
=
"2"
/>
<
StackPanel
Orientation
=
"Horizontal"
HorizontalAlignment
=
"Left"
Grid.Column
=
"0"
Grid.Row
=
"1"
Background
=
"#EEEEEE"
>
<
Button
x:Name
=
"btnSend"
Style
=
"{StaticResource ButtonSendStyle}"
/>
<
Button
x:Name
=
"btnCancel"
Style
=
"{StaticResource ButtonCancelStyle}"
/>
<
Button
x:Name
=
"btnSave"
Style
=
"{StaticResource ButtonEmailSaveStyle}"
/>
<
Button
x:Name
=
"btnDocTemplate"
Style
=
"{StaticResource ButtonSelectTemplateStyle}"
/>
<
TextBlock
x:Name
=
"tbSizeLabel"
VerticalAlignment
=
"Center"
FontSize
=
"12"
Text
=
"Size:"
Grid.Column
=
"0"
Margin
=
"10,2,0,2"
/>
<
TextBlock
x:Name
=
"tbSize"
VerticalAlignment
=
"Center"
FontSize
=
"12"
Text
=
"0"
Foreground
=
"Navy"
Grid.Column
=
"1"
Margin
=
"5,2,5,2"
/>
</
StackPanel
>
<
StackPanel
Orientation
=
"Horizontal"
HorizontalAlignment
=
"Stretch"
Grid.Column
=
"1"
Grid.Row
=
"1"
Background
=
"#EEEEEE"
>
</
StackPanel
>
<
StackPanel
Orientation
=
"Horizontal"
HorizontalAlignment
=
"Right"
Grid.Column
=
"2"
Grid.Row
=
"1"
Background
=
"#EEEEEE"
>
<
Button
Content
=
"+ File"
x:Name
=
"btnAddAttachment"
/>
<
Button
Content
=
"+ Existing File"
x:Name
=
"btnAddExistingAttachment"
/>
<
Button
Content
=
"- File"
x:Name
=
"btnRemoveAttachment"
/>
</
StackPanel
>
</
Grid
>
<
TextBox
x:Name
=
"txtId"
Visibility
=
"Collapsed"
/>
</
Grid
>
</
UserControl
>
model layer functions
[DependencyPropertyBinding(Name = "htmlProvider", DependencyProperty = "Html")]
public String MessageBody
{
get
{
return GetProperty<
String
>("MessageBody");
}
set
{
SetProperty<
String
>("MessageBody", value);
}
}
private IEnumerable<
IExecutable
> uploadEmail()
{
//the Message object is a custom object which just holds the data to be save in mysql
Message.From = "mymail@mymail.com";
Message.OutgoingServer = SelectedAccount.OutgoingServer;// some object with the servers settings
// Upload body to a temp location
TemporaryFolder folder = new TemporaryFolder(new FileSystemManager());
TemporaryFile bodyFile = folder.CreateFile(MessageBody, Guid.NewGuid().ToString() + ".html");
IExecutableResult<
IWebFileStorage
> bodyRequest = AttachmnetFileManager.UploadFileAsExecutable(bodyFile, "Mail");
//service call
yield return bodyRequest;
//set message location
Message.Location = bodyRequest.Result.Location;
WebTransactionCollection transactions = new WebTransactionCollection();
//add to a list
transactions.AddTransaction(OutgoingMessageService.Save(Message), "OutgoingMessage");
//saves the transaction and returns the saved outgoing message.
IExecutableQueryHandler outgoingmessageHandler = OutgoingMessageService.TransactionWithResponse(transactions);
yield return outgoingmessageHandler;
}
as you can see i dont do much more than take the html from the rich text editor and then storing onto a file system and then adding the record to the database. where it sits in a queue of to be send items.