You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

format the message text such as BOLD or change of colour using sendmail peoplecode

6 replies [Last post]
Guest's picture
Guest

Hello,
I have created a custom page to send emails usind sendmail() function. How to format the message text such as BOLD, underline, change color of text or insert image.
Any help will be appreciated.
Thanks

Guest's picture
Guest (not verified)
Re: format the message text such as BOLD or change of colour ...

Hi,
I would prefer you to use delivered app package PT_WF_NOTIFICATION instead of send mail.

For sending emails, create an notification template and in that template use html tags to format your message content.

Regards,

Rahul Khandelwal

Lepa's picture
User offline. Last seen 1 day 12 hours ago. Offline
Joined: 06/23/2008
Posts: 464
Re: format the message text such as BOLD or change of colour ...

Yes, i agree with Rahul, I've used the notification class before to send HTML emails and it works great.

Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog

Guest's picture
Guest (not verified)
Re: format the message text such as BOLD or change of colour ...

Hi,

Can u pls give the code to get letters in bold.am using PT_WF_NOTIFICATION only bt unable to get in bold.

Thanks in advance.

Cheers,
Lucky

rahulkhandelw's picture
User offline. Last seen 3 weeks 9 hours ago. Offline
Joined: 10/16/2009
Posts: 26
Re: format the message text such as BOLD or change of colour ...

There is no code as such.. u need to use html tags in ur email template.

Guest's picture
Guest (not verified)
Re: format the message text such as BOLD or change of colour ...

I have used html tags but they are displaying with tags in mail.

Guest's picture
Guest (not verified)
Re: format the message text such as BOLD or change of colour ...

Below is the code.I have created a notification template and then used html tags but still unable to get the text in bold.The html tags are visible.Any idea how to avoid display of html tags?

Local PT_WF_NOTIFICATION:NotificationTemplate &ETemplate;

&Msg1 = MsgGetExplainText(30000, 5, "some text");
&Msg2 = "Descr: " | &Err_Msg | "";
&Msg = &Msg1 | &Msg2;

&ETemplate = create PT_WF_NOTIFICATION:NotificationTemplate("", "", "Example", "G");
&aryValues = CreateArrayRept("", 0);
&aryValues.Push(&Msg);
&xmlVars = &ETemplate.SetupGenericVars(&aryValues);
&Temp = &ETemplate.GetAndExpandTemplate(%Language, &xmlVars);

&mynotification.Message = &ETemplate.Text;
&mynotification.ContentType = "text/html; charset=UTF-8";
&mynotification.Send();

Thanks,

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
The question below is to prevent automated spam submissions.
7 + 3 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.