Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Sending E-mail in HTML format

Former Member
0 Likes
6,535

Hello All,

I have to send e-mail to a customer but the e-mail should be sent out in an HTML Format which would look good..

I know the FM to send the e-mail but how to build the body in the HTML format because i have a big bunch of text.

Is there any way to create a HTML template in SMW0 and read the same using any function modules to build the body like given below...

Eg:

Dear Customer

........

.......

......

Multiples lines of text....

Your suggestions are highly appreciated.

Regards,

Krishnakumar

21 REPLIES 21
Read only

Former Member
0 Likes
2,613

HI,

Refer this link..[How to send the email in HTML format|;

Read only

0 Likes
2,613

Hello,

I dont want to hardcode the HTML content.. And my requirement is not to send a spool list as HTML..

Could you please provide suggestions.

Regards,

Krishnakumar

Read only

0 Likes
2,613

you can build the body by calling read_text FM and mainatiane the text in Standard text SO10 tr. based on the format you want to send the email.. you can call relevant standard text and send the email by building the HTML tags... and email body..

Read only

0 Likes
2,613

HI,

Check this FM WWW_ITAB_TO_HTML

Read only

0 Likes
2,613

Try this way


  submit yXXXXX0001 exporting list to memory " Write a report for HTML body and properly format
                                                                   " and submit the report to list to memory
           with p_docno = xdocno
           and return.

  call function 'LIST_FROM_MEMORY'
    tables
      listobject = report_list
    exceptions
      not_found  = 1
      others     = 2.

  call function 'WWW_HTML_FROM_LISTOBJECT'
    exporting
      template_name = 'WEBREPORTING_REPORT'
    tables
      html          = report_html
      listobject    = report_list.

Here internal table report_html contains body for HTML mail in HTML tags

a®

Read only

Former Member
0 Likes
2,613

Hello All,

Is there any function module to read the HTML template from MIME repository..

Regards,

Krishnakumar

Read only

0 Likes
2,613

Check FM

WWW_GET_SCRIPT_AND_HTML - To get the HTML templates

WWW_HTML_MERGER - To merge data into the template and make the final HTML data

Regards,

Naimesh Patel

Read only

Former Member
0 Likes
2,613

Hi KrisnaKumar,

Can you please check the following Fm.....

DSVAS_HTML_MIME_LOAD

HTMLCNTL_LOAD_MIME_OBJECT

DSVAS_HTML_MIME_KEY_GET

Thanks and Regards,

Senthil Kumar Anantham.

Read only

Former Member
0 Likes
2,613
Read only

Former Member
0 Likes
2,613

Hi,

Check the below Link

https://www.sdn.sap.com/irj/scn/forums

Hope this helps you.

Regards,

Anki Reddy

Read only

Former Member
0 Likes
2,613

Hello All,

Thanks for your answers, but still i am wondering whether it is possible to

insert a gif image such as company logo in the signature along with the e-mail..

you are answers are highly appreciated.

Regards,

Krishna

Read only

0 Likes
2,613

Hi,

Check this link [Gif image in the email body|https://www.sdn.sap.com/irj/scn/directforumsearch?threadid=&q=gifimageintheemail+body&objID=c42&dateRange=all&numResults=30&rankBy=10001]

Read only

Former Member
0 Likes
2,613

If you are using smartforms then try the following standard report it migght help you

sf_xsf_demo_mail

it is used to send smartforms with graphics as email body without an attachment

i hope it might help you

Read only

Former Member
0 Likes
2,613

Hello,

I am not using Smartforms, I am trying to frame a simple HTML e-mail where i can present it better.

can anyone give me an an example how to embed images in the body of the HTML e-mail .One more issue that i have faced is

i am setting the table properties like below

<table border="1">

<tr><td>testcolumn</td></tr>

</table>

but when i send the email to the notes/outlook client the border appears to be huge

your answers are highly appreciated.

Regards,

Krishnakumar

Read only

Former Member
0 Likes
2,613

can anyone respond to this

Regards,

Krishnakumar

Read only

0 Likes
2,613

          MailMessage mail = new MailMessage();

            mail.To.Add("xxxxxxxxx@gmail.com");

            mail.From = new MailAddress("test@test.com", "ABC XYZ");

            mail.Subject = " Your Subject ";

            mail.IsBodyHtml = true;

            mail.Body = "<html> <body>  <div> Your Content </div> </body></html> ";

           

            SmtpClient stp = new SmtpClient();

            stp.Host = "mail.technicalsolution.us";

            stp.Credentials = new System.Net.NetworkCredential("youremailid", "yourpassword");

            stp.Send(mail);

Read only

Former Member
0 Likes
2,613

I tried using the following tag while building the body of the e-mail.

<table border = "1" border-collapse="collpase">

<tr><td>test1</td></tr>

</table>

But still border appears to be very thick when i send the e-mail to Lotus notes / Outlook

can anyone suggest me what would be the problem ?

Thanks in advance

Regards,

Krishnakumar

Read only

Former Member
0 Likes
2,613

Fixed on my own..

Read only

0 Likes
2,613

Namaste krishnakunar.

How do you solve this??

i am working to send mail from sap with forma html, i like to put logo from my company.

for the moment i put url from a public link and it is work fine.. but i like to insert logo (pdf) into sap with transaction smw0, and after in my program read this data and put in html format.

Regards.

Antonio

Read only

rosenberg_eitan
Active Contributor
0 Likes
2,613

Hi,

Check this please.

Regards

Read only

Sidhant-Acharya
Participant
0 Likes
2,613