adding colours in EMAILS

Hi,

One of our client wants to get colurful email in their mailbox in an HR process. Is it possible in wM to send emails with colourful fonts ?

Note: Client does not want to receive the emails as an html attachment. :slight_smile:

Yes. You can form the your business content using HTML tags and you an include font color as well and finally give the content to “body” in smtp service, then this email will not come as a attachment

Hi Arul,

I tried this. Not working.
It is not resolving the HTML tags…I am getting the html tags in the body of the email when received in my inbox.

It is working now.
Below is the solution

  1. string to Byte
  2. byte to stream
  3. pub.mime:createMimeData
  4. pub.mime:addBodyPart (content Type =text/html)
  5. pub.mime:getEnvelopeStream
  6. pub.client:smtp

thanks everybody.

Hello,

Maybe i have meet the same question. But customer also want to attach several excel/test report as attachments in the colour font email.

In the service (pub.client:smtp)though it is mapping to ‘attachments’ list, the email is still no attachments.

What should i do? tks~:mad:

Hi Arul, What is the input to the “string to byte” service ? Is it the HTML content ?? and is stream which is the output of “byte to stream” the input to “createMimeData” ? Can you please let me know. I am stuck up.

Thanks

hi,

There is another way to do it. Sounds a bit strange but works fine.

  1. form your string with all the html tags.
  2. convert this to bytes.
  3. pass this to attachments/content of the pub.client:smtp service

The email does not go as attachment and the html messages comes in the email Body.

Hi Arul,

I am getting the same HTML code in the email body which i don’t want. I want it to be displayed the way it displays in the browser. thanks for your help.

Stepheny

Hi Stepheny,

I think you forgot to set the attachments/contenttype = text/html

check the attached file with this post. I have provided screen shots of the wM code and the output. It might help you.

thanks
wMcolorfulEmail.doc (69 KB)

Hi Arul,

Wonderful. you are awesome. It worked. Thanks for your quick response. I have another question regarding this.
I want to give the run time pipeline values in the HTML so that they display in the email. If i have a pipeline string “A” with value “Stepheny” then how do I make it display. Can I use the same %value A% in the HTML and it would display ? I tried and it did not work. So I am wondering if we have to do anything else.

Thanks

Hey Arul,

I got it. I just have to go with regular WM type %variablename% and it would work. There is no need of %value variablename% like we do to create a DSP. I thought too much. Thanks for all your help and time.

Stepheny.

webMethods provides few publish services in WmPublic/pub.report, that can also be used to achive such requirements.

You can define your output tamplate or DSP pages and use mPublic/pub.report:runTemplateOnPipe to bring that in to your pipeline and send as an email.

The services in WmPublic/pub.report can give you lot of additional benifits for reporting solutions.

Thanks
AmaR

Hi,

My HTML keeps changing in my map based on the values. So I dont have an actual template . I have a question about the images.

Just like in html i give this code to get the image in the browser

If i am trying to pass this in the bytes to SMTP it does not display the image in the email body. Do we have to do something extra to get the images?

Thanks in advance.

this is the simple way…

  1. set contentType = text/html
  2. set content = Html formated
  3. pass this to attachments/content of the pub.client:smtp service

This really is the simple way!Thank you!

LOL, I was wondering why nobody mentioned this straight away. I guess the simplest solution is sometimes the hardest to see (or know about). Anyhow, do these setting allow for the excel attachments to be also in html, like Kevin Chang asked about?

does this works on outlook also??

YES with html content-type:

Thanks rmg and all who commented.
Indeed it works on outlook as well.

hi all
im trying to add an image to it also but the image doesnt show up in outlook
first of all can we add image ?
wat path shud i give for img source or where shud i place it
wen i give relative path it doesnt work /apps/webmethods111/Integration…
im using unix server