cancel
Showing results for 
Search instead for 
Did you mean: 

how to change Font of mail content

Former Member
0 Kudos

Dear Abapers,

I am having a requirement in which i have to send smartform as an attached PDF through e-mail. I have done that successfully, but the client also want the content of the mail to be of specific font.

The mail is having two things

1. PDF File - Which has been successfully implemented.

2. Some Content in the Mail body in a specific Font(Verdana), I am able to send the content also but dont know how to change the font.

I am using the following function module to send the email:-

FUNCTION 'SO_DOCUMENT_SEND_API1'

Now please tell me is it possible that we can have mail content be font specific? If so, how?

Thanks and regards

Manpreet Singh

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks to all of you my friends for your valuable support. I have found the answer for my query, once gain thanks a lot.

Former Member
0 Kudos

We do by inserting HTML commands into the mail content.... for instance:

lt_content-line = '<p style="font-family:arial;font-size:12pt">' .

and for other controls, such for double space, then write caption in bold::

concatenate '<br/><br/><br/><b>TEXT VALUE:&nbsp&nbsp  </b>' table-field into lt_content-line respecting blanks.

or to change size:

lt_content-line = '</p><p style="font-family:arial;font-size:10pt">'.

You may also need something for the heading, which we do like:

lt_head-line        = '&SO_FONTTYPE=ARIAL'.
      append lt_head.

Edited by: BreakPoint on Jul 15, 2010 7:39 PM

Former Member
0 Kudos

Hi BreakPoint,

When inserting the following commands in the mail content, these command lines are getting displayed in the body of the mail.(as it_content is a table parameter passing in CONTENTS_TXT of FM).Can you please give more details about your solution.Also please let us know if the following changes/command lines are possible when sending mails using Classes (CL_BCS).

Regards,

Thoufique.

brad_bohn
Active Contributor
0 Kudos

Of course, if you have CL_BCS then you should definitely use it. In either case, you need to set the mail type as 'HTM' (HTML-based). Example:


      LR_DOCUMENT = CL_DOCUMENT_BCS=>CREATE_DOCUMENT(
                      I_TYPE    = 'HTM'
                      I_TEXT    = LT_TEXT
                      I_SUBJECT = SUBJECT ).

Former Member
0 Kudos

Thanks a lot Brad, Is there any way to customize the color of the body/content(like green/blue....).

Regards,

Thoufique.

brad_bohn
Active Contributor
0 Kudos

You are only limited by the boundaries of HTML - whatever HTML can do, you can do in an HTML-based email from SAP. I find it helpful to use macros when building HTML emails. If you're not familiar with HTML, CSS, etc., then you can use tools to build it (even MS Word works) or you can look at the source of existing emails or web pages. Keep in mind those poor folks who still don't use HTML capable email viewers or have it turned off and how it will look to them.