CodeGarden 10: The sixth annual Umbraco Developer Conference
June 23-25th 2010 - free ASP.NET MVC pre-conference. Register today!

modifying the mail engine from nibblebe

Go directly to solutionA reply has been marked as a solution
2/8/2010 8:55:55 PMAvatarJan SkovgaardLocation: Viby j, Denmarkposts: 437Karma: 1954

Hi

Currently I'm working on a solution, from which the customer needs to send newsletters using the great Mail Engine created by Tim G.

But the client is not happy about the images that are used to layout the e-mail template is being attached to the sent e-mail. I know this has to do with the images being replaced with a cid.

Therefore I need to modify the code in the helper.cs file so I get the url to the image instead. I'm not sure how much should be changed but I don't think it's enough to outcomment linke 183, which reads: body = body.Replace(image, "cid:" + contentId);

But I'm having some trouble breaking down the code and fully understand what it does and why. So I would be very happy if someone could give me a few hints on what to do :-)

I don't know that much about how html-email are normally treated etc. only that it's possible to avoid the images being attached to the e-mail.

The source code for the project can be found here: http://www.nibble.be/temp/MailEngine.zip

/Jan

2/8/2010 9:07:05 PMAvatarPeter DijksterhuisLocation: Swifterbant, 8255EA, NLposts: 1266Karma: 1394
Comment with ID: 25709

Hi Jan,

I think you can safely comment line 163 to 194 (from else to the matching })

Also comment line 199 (attaches the images)

HTH,

Peter

2/8/2010 9:14:29 PMAvatarPeter DijksterhuisLocation: Swifterbant, 8255EA, NLposts: 1266Karma: 1394
Solution Comment with ID: 25712
2

Spoke too soon I guess....

comment out line 172 to 193 EXCEPT line 192

That should do the trick (my first answer doesn't give you http-images, just relative paths)

2/8/2010 9:20:12 PMAvatarJan SkovgaardLocation: Viby j, Denmarkposts: 437Karma: 1954
Comment with ID: 25713

Hi Peter

Thank you very much - this seems to have done the trick! :-)

/Jan

2/9/2010 9:30:24 AMAvatarJan SkovgaardLocation: Viby j, Denmarkposts: 437Karma: 1954
Comment with ID: 25753

I was to fast there. Did just check in gmail yesterday since I don't use either Thunderbird or Outlook at home. Here at work I have just checked in outlook and the images are not showing.

But that's not so weird afterall since the image src looks like this:

<img src="http://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.comhttp://mydomain.com/images/email/sep.gif" width="182" height="9" border="0" hspace="0" vspace="0" align="left">

Now I just can't figure out why the domain is being repeated so many times?

/Jan

2/9/2010 9:54:45 AMAvatarJan SkovgaardLocation: Viby j, Denmarkposts: 437Karma: 1954
Comment with ID: 25756

Just solved the issue by doing what Peter is suggesting in his first post.

I commented line 163-194 (not 199 since this seems to break the engine) and in my HTML e-mail I just put <base href="http://mydomain"> and now it's working :)

/Jan

Please login or Sign up To post replies