Michael

Michael

  • NA
  • 12
  • 0

Maildefinition & Embedding Object

Jan 7 2011 5:01 AM

I am creating email using the MailDefintion class. Everything works fine until I try and embed and object. and once I do that it just sends a blank email. When I remove the emeddedobject it works fine
Anyone had this?
 

 AlternateView plainView = AlternateView.CreateAlternateViewFromString(plainEmail, null, "text/plain");
msg.AlternateViews.Add(plainView);
 
MailDefinition message = new MailDefinition();
message.BodyFileName = "email.htm";
message.IsBodyHtml = true;
message.From = TextBoxYourEmail.Text;
message.Subject = "Zoo Event: " + labelEventName.Text
 
//Here is the problem
EmbeddedMailObject emo = new EmbeddedMailObject();
emo.Path = @"~\Images\email\hdr_roar.gif";
emo.Name = "hdr";
 
EmbeddedMailObject emo2 = new EmbeddedMailObject();
emo2.Path = @"~\Images\email\box_top.gif";
emo2.Name = "box_top";
 
message.EmbeddedObjects.Add(emo2);