Published by

Comments

# re: Sending Email using WPF and C#

Saturday, March 28, 2009 5:15 AM by Shaoun

What will happen if we want to send an image as image resource?

# re: Sending Email using WPF and C#

Saturday, March 28, 2009 5:16 AM by Shaoun

What will happen if we want to send an image as image resource?

# re: Sending Email using WPF and C#

Monday, March 30, 2009 1:45 PM by Md Nazmul Ahsan

You can attached the image file as email attachment using following code line.

==========================================================

oMessage.Attachments.Add(new Attachment([Attachment Path]));

==========================================================

# re: Sending Email using WPF and C#

Monday, March 30, 2009 2:41 PM by MD.ZAHIDUL ISLAM

If you check the WPFEmailer Class closely, you will find AttachmentPath where you have to specify the path of your image resource.

If you want to send "test.gif" image, you have to write the following code:

.....................................................

wpfEmailer.Attachments.Add(new

                 Attachment("c:\\test.gif"));

.....................................................

Enjoy sending Email.Thank you.

# re: Sending Email using WPF and C#

Friday, April 03, 2009 3:58 AM by Shaoun

Hello, Thanks for your reply. I am not talking about adding attachment. I am talking about sending image as an embedded image. You have to create the message content in multiple view. That is plain text view and HTML view. Then you have to create a linked resource and add that to the HTML view. Combine them and send it. Here is the code:

Dim plainView as New AlternateView= AlternateView.CreateAlternateViewFromString("Plain text part can be viewed by those clients that don't support html", null, "text/plain")

Dim htmlview as New AlternateView=AlternateView.CreateAlternateViewFromString("Here is an embedded image."", null, "text/html")

Dim logo as new LinkedResource = LinkedResource( "c:\temp\companylogo.gif" )

logo.ContentId = "logo"

htmlView.LinkedResources.Add(logo)

mail.AlternateViews.Add(plainView)

mail.AlternateViews.Add(htmlView)

That is the correct way of sending embedded images. Also, it has a great advantages. If some client is unable to view the HTML part then .net mail class will deliver the plain text part. Thank you.

# re: Sending Email using WPF and C#

Friday, April 03, 2009 5:30 AM by MD.ZAHIDUL ISLAM

Thank you Shaoun for your comments and demo code.

# re: XBAP versus Silverlight application

Wednesday, July 01, 2009 11:27 AM by Md Nazmul Ahsan

Great job... Now it is clear to me when I have to use Silverlight or WPF Browser Application.

One issue is with it player, it is already become < 6 with v3.

One ? >> Does silverlight v3 support backward comparability?

# re: XBAP versus Silverlight application

Wednesday, July 01, 2009 1:38 PM by MD.ZAHIDUL ISLAM

Thank you Md Nazmul Ahsan.

I know a lots of debate around us about the Backward Compatibility of Silverlight 3.

One of the goals of new versions of Silverlight is to be be backward compatible with previous versions. So that people can keep their previous applications deployed while not worrying that people with newer Silverlight will have a broken experience.

Check your Silverlight 2 apps for compatibility with Silverlight 3.

you can get more information about how to check Silverlight 2 apps are compatible with Silverlight 3:

timheuer.com/.../verify-your-silverlight-application-compatibility.aspx

Powered by Community Server (Non-Commercial Edition), by Telligent Systems