Send html content in notification body

Hi, I am trying to make the body of my mail as html. But an empty mail is getting sent. The code is,
<copy>
<from expression="ora:processXSLT('Transformation_1.xsl',bpws:getVariableData('inputVariable','payload','/ns2:ORDER'))"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns3:Content/ns3:ContentBody"/>
</copy>
<copy>
<from expression="string('text/html; charset=UTF-8')"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns3:Content/ns3:MimeType"/>
</copy>
The xsl has the code:
<xsl:template match="/">
<ns0:ORDER>
<xsl:attribute name="ErrState">
<xsl:value-of select="/ns0:ORDER/@ErrState"/>
</xsl:attribute>
</ns0:ORDER>
</xsl:template>
I can see the ContentBody variable in the AuditTrail with the processed value. but in mail I am not getting anything.
Please help me on this

What happens if the user isn't reading the message in a HTML enabled mail client?
Besides, even if you don't want to send an equivelant message in plain text, at least say something like 'Please open the message in an HTML enabled mail client'.
It is a required field, so requires some value (not null).
From the docs:
Plain text and HTML email content. Passing a value to p_body, but not p_body_html results in a plain text message. Passing a value to p_body and p_body_html yields a multi-part message that includes both plain text and HTML content. The settings and capabilities of the recipient's email client determine what displays. Although most modern email clients can read an HTML formatted email, remember that some users disable this functionality to address security issues.

Similar Messages

  • Sending HTML content in body for emailnotification in OSB

    hi,
    i have done an emailnotification service in OSB..
    currently HTML content in body is not supported in OSB..
    how to send the html content as body for an email..
    please provide a solution at the earlist..
    thanks

    how to send the html content as body for an emailSimply as you send a XML. Post OSB related queries in SOA suite forum -
    SOA Suite
    Regards,
    Anuj

  • Not able to Send HTML Content in Apex Mail

    Hi,
    I am using Oracle Apex 4.2 and Oracle 11g XE
    I am trying to add HTML content in the apex_send mail procedure. But it give me the below error.
    >>•ORA-06502: PL/SQL: numeric or value error: invalid LOB locator specified: ORA-22275
    Below is the code i am trying to add in the apex_send mail
    DECLARE
    l_from varchar2(1000);
    l_body CLOB;
    l_body_html CLOB;
    BEGIN
    l_body := null;
    l_body_html := '
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta property="og:title" content="Seasons Greetings from sudhir Networks" />
    <title>Seasons Greetings from sudhir Networks</title>
    <style type="text/css">
    /* Client-specific Styles */
    #outlook a{padding:0;} /* Force Outlook to provide a "view in browser" button. */
    body{width:100% !important;} .ReadMsgBody{width:100%;} .ExternalClass{width:100%;} /* Force Hotmail to display emails at full width */
    body{-webkit-text-size-adjust:none;} /* Prevent Webkit platforms from changing default text sizes. */
    /* Reset Styles */
    body{margin:0; padding:0;}
    img{border:0; height:auto; line-height:100%; outline:none; text-decoration:none;}
    table td{border-collapse:collapse;}
    #backgroundTable{height:100% !important; margin:0; padding:0; width:100% !important;}
    body, #backgroundTable{
    /*@editable*/ background-color:#FAFAFA;
    #templateContainer{
    /*@editable*/ border: 1px solid #DDDDDD;
    h1, .h1{
    /*@editable*/ color:#202020;
    display:block;
    /*@editable*/ font-family:Arial;
    /*@editable*/ font-size:34px;
    /*@editable*/ font-weight:bold;
    /*@editable*/ line-height:100%;
    margin-top:0;
    margin-right:0;
    margin-bottom:10px;
    margin-left:0;
    /*@editable*/ text-align:left;
    h2, .h2{
    /*@editable*/ color:#202020;
    display:block;
    /*@editable*/ font-family:Arial;
    /*@editable*/ font-size:30px;
    /*@editable*/ font-weight:bold;
    /*@editable*/ line-height:100%;
    margin-top:0;
    margin-right:0;
    margin-bottom:10px;
    margin-left:0;
    /*@editable*/ text-align:left;
    h3, .h3{
    /*@editable*/ color:#202020;
    display:block;
    /*@editable*/ font-family:Arial;
    /*@editable*/ font-size:26px;
    /*@editable*/ font-weight:bold;
    /*@editable*/ line-height:100%;
    margin-top:0;
    margin-right:0;
    margin-bottom:10px;
    margin-left:0;
    /*@editable*/ text-align:left;
    h4, .h4{
    /*@editable*/ color:#202020;
    display:block;
    /*@editable*/ font-family:Arial;
    /*@editable*/ font-size:22px;
    /*@editable*/ font-weight:bold;
    /*@editable*/ line-height:100%;
    margin-top:0;
    margin-right:0;
    margin-bottom:10px;
    margin-left:0;
    /*@editable*/ text-align:left;
    #templatePreheader{
    /*@editable*/ background-color:#FAFAFA;
    .preheaderContent div{
    /*@editable*/ color:#505050;
    /*@editable*/ font-family:Arial;
    /*@editable*/ font-size:10px;
    /*@editable*/ line-height:100%;
    /*@editable*/ text-align:left;
    .preheaderContent div a:link, .preheaderContent div a:visited, /* Yahoo! Mail Override */ .preheaderContent div a .yshortcuts /* Yahoo! Mail Override */{
    /*@editable*/ color:#336699;
    /*@editable*/ font-weight:normal;
    /*@editable*/ text-decoration:underline;
    #templateHeader{
    /*@editable*/ background-color:#FFFFFF;
    /*@editable*/ border-bottom:0;
    .headerContent{
    /*@editable*/ color:#202020;
    /*@editable*/ font-family:Arial;
    /*@editable*/ font-size:34px;
    /*@editable*/ font-weight:bold;
    /*@editable*/ line-height:100%;
    /*@editable*/ padding:0;
    /*@editable*/ text-align:center;
    /*@editable*/ vertical-align:middle;
    .headerContent a:link, .headerContent a:visited, /* Yahoo! Mail Override */ .headerContent a .yshortcuts /* Yahoo! Mail Override */{
    /*@editable*/ color:#336699;
    /*@editable*/ font-weight:normal;
    /*@editable*/ text-decoration:underline;
    #headerImage{
    height:auto;
    max-width:600px;
    #templateContainer, .bodyContent{
    /*@editable*/ background-color:#FFFFFF;
    .bodyContent div{
    /*@editable*/ color:#505050;
    /*@editable*/ font-family:Arial;
    /*@editable*/ font-size:14px;
    /*@editable*/ line-height:150%;
    /*@editable*/ text-align:left;
    .bodyContent div a:link, .bodyContent div a:visited, /* Yahoo! Mail Override */ .bodyContent div a .yshortcuts /* Yahoo! Mail Override */{
    /*@editable*/ color:#336699;
    /*@editable*/ font-weight:normal;
    /*@editable*/ text-decoration:underline;
    .bodyContent img{
    display:inline;
    height:auto;
    #templateFooter{
    /*@editable*/ background-color:#FFFFFF;
    /*@editable*/ border-top:0;
    .footerContent div{
    /*@editable*/ color:#707070;
    /*@editable*/ font-family:Arial;
    /*@editable*/ font-size:12px;
    /*@editable*/ line-height:125%;
    /*@editable*/ text-align:left;
    .footerContent div a:link, .footerContent div a:visited, /* Yahoo! Mail Override */ .footerContent div a .yshortcuts /* Yahoo! Mail Override */{
    /*@editable*/ color:#336699;
    /*@editable*/ font-weight:normal;
    /*@editable*/ text-decoration:underline;
    .footerContent img{
    display:inline;
    #social{
    /*@editable*/ background-color:#FAFAFA;
    /*@editable*/ border:0;
    #social div{
    /*@editable*/ text-align:center;
    #utility{
    /*@editable*/ background-color:#FFFFFF;
    /*@editable*/ border:0;
    #utility div{
    /*@editable*/ text-align:center;
    #monkeyRewards img{
    max-width:190px;
    </style>
    </head>
    <body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0">
    <center>
    <table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="backgroundTable">
    <tr>
    <td align="center" valign="top">
    <table border="0" cellpadding="0" cellspacing="0" width="600" id="templateContainer">
    <tr>
    <td align="center" valign="top">
    <!-- // Begin Template Header \\ -->
    <table border="0" cellpadding="0" cellspacing="0" width="600" id="templateHeader">
    <tr>
    <td class="headerContent">
    <img src="http://www.sudhirnetworks.com/i/logo/sudhir-logo.png" style="max-width:600px; padding-top: 20px;" id="headerImage campaign-icon" mc:label="header_image" mc:edit="header_image" mc:allowdesigner mc:allowtext />
    </td>
    </tr>
    </table>
    <!-- // End Template Header \\ -->
    </td>
    </tr>
    <tr>
    <td align="center" valign="top">
    <!-- // Begin Template Body \\ -->
    <table border="0" cellpadding="0" cellspacing="0" width="600" id="templateBody">
    <tr>
    <td valign="top" class="bodyContent">
    <!-- // Begin Module: Standard Postcard Content \\ -->
    <table border="0" cellpadding="20" cellspacing="0" width="100%">
    <tr mc:repeatable>
    <td valign="top">
    <img src="http://www1.sudhirnetworks.com/ecard/sudhir_holidaycard_clickhere.jpg" style="width:560px;" mc:label="postcard_image" mc:edit="postcard_image" mc:allowtext />
    <div mc:edit="std_content00">
    <strong>Custom Message</strong> goes here.
    </div>
    </td>
    </tr>
    </table>
    <!-- // End Module: Standard Postcard Content \\ -->
    </td>
    </tr>
    </table>
    <!-- // End Template Body \\ -->
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </center>
    </body>
    </html>
    l_from := lower(:app_user) || lower('@sudhirnetworks.com');
    apex_mail.send(
    p_to => :P1_TO,
    p_from => l_from,
    p_body => l_body,
    p_body_html => L_BODY_HTML,
    p_subj => :P1_SUBJECT);
    APEX_MAIL.PUSH_QUEUE;
    END;
    Please suggest me how to fix this issue.
    Thanks
    Sudhir

    What happens if the user isn't reading the message in a HTML enabled mail client?
    Besides, even if you don't want to send an equivelant message in plain text, at least say something like 'Please open the message in an HTML enabled mail client'.
    It is a required field, so requires some value (not null).
    From the docs:
    Plain text and HTML email content. Passing a value to p_body, but not p_body_html results in a plain text message. Passing a value to p_body and p_body_html yields a multi-part message that includes both plain text and HTML content. The settings and capabilities of the recipient's email client determine what displays. Although most modern email clients can read an HTML formatted email, remember that some users disable this functionality to address security issues.

  • Sending rtf content in javamail body

    hi all,
    i am trying to send a newsletter in the body of the mail instead of an attachment.
    can anyone tell me how to acheive it.

    hi bshannon,
    first of all thanks for your reply. Let me explain you what i am trying to acheive. I have a rtf doc with me with lots of images and text. I want this to go in as body of the message and not as an attachment. Here is what i am trying..
    MimeMessage message = new MimeMessage(session);
    message.setSender(new InternetAddress(sender));
    message.setSubject(subject);
    DataSource fds = new FileDataSource("D:/Documents and Settings/karthik/Desktop/test/NewsLetter.doc");
    message.setDataHandler(new DataHandler(fds));
    here is where i am unable to understand how to put this message.setDataHandler() thing in to the body of the message as we dont have a method addBodyPart() in mimemessage object as we have in the MimeMultipart..
    message.setContent(body, "text/rtf");
    Transport.send(message);
    thanks again,
    karthik.

  • How to Send HTML Email from Webpage?

    Hi Everyone!
    I'm Looking to Send Emails with an Option to Send Text Format (from textfile on Webserver, ex. textfile.txt) or HTML Format (from webpage on Web Server, example: test.html).
    I will include My Current Code at the end of this Q.
    What Code will I need to use to create the Option, extract the data from the .txt file Or HTML File, and send the Content in the Body of the E-mail?
    Also, how can I send the e-mails (both HTML and/or Text Format) to Multiple Recipients by adding the names into the '$email' textbox on the current form?
    Thanks in Advance!

    Which class are u using for the same purpose ?

  • B1if Sending HTML Email

    Is it possible to send HTML emails through a sndEmail atom?  If so, how do we configure the atom?

    Hello All,
    Regarding to the mail adapter, here are some updates:
    1. B1i will support sending HTML attachemnt via "Send Email" atom in B1 882 PL09. An example here:
    <attachment doc="test.htm" pltype="htm">
    <![CDATA[<html>
      <head>
        <title>Enter the title of your HTML document here</title>
      </head>
      <body>
        <p>Enter the body text of your HTML document here</p>
      </body>
    </html>]]>
    </attachment>
    2. In addition, B1i will support sending binary attachment and sending html content in Q1,2013.
    Thanks & Best Regards,
    Qiaoli

  • Need to send HTML table via email

    Hi Experts,
    I am using the FM EFG_GEN_SEND_EMAIL to send email but unable to send html content through this. I know I could use SO_SEND_OBJECT FM too which automatically sends the email in HTML format but it doesn't have from option(FROM EMAIL ID)
    I tired manually chaning the format from RAW to HTM via debugging and then found that its sending the html format email.
    Request you to please let me know if we could achieve the same.
    Thanks,
    Rajwin

    Hi,
    rcently we idd this requirment .
    But every thing we did it from ABAP side   not from WDJ Side
    Generation of PDF after enterring the data will be send via email along with PDF Data so try to use  Smart Forms
    Regards,
    Govindu

  • Sending HTML + related images + attachments

    Hello,
    I want to send an HTML file + related images + attachments.
    I actually succeeds in sending HTML content + related images.
    I also know how to attach files in a mail.
    But when I want to have both of those functionnalities in the same mail, I miserably fail... ;)
    Does anyone have a simple example that sends an HTML file + related images + attachments??
    HELP!!!!
    Denis.

    USe this as a **guide**.
    Its sends images + altText(similar to attachment, except that its embedded + html)
    public static void sendC()throws Exception{
              String host = "xx";
              String from = "xxx";
              String to = "xxx";
              String file = "logo.gif";
              Properties props = System.getProperties();
              props.put("mail.smtp.host", host);
              Session session = Session.getDefaultInstance(props, null);
              Message message = new MimeMessage(session);
              message.setSubject("Embedded Image");
              message.setFrom(new InternetAddress(from));
              message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
              MimeMultipart multipart1 =new MimeMultipart("related");
              //multipart1.setSubType("alternative");
              MimeMultipart multipartBody = new MimeMultipart("alternative");
              MimeBodyPart part=new MimeBodyPart();
              part.setContent("textMessage","text/plain");
              multipartBody.addBodyPart(part);
              part=new MimeBodyPart();
              String htmlText = "<H1>Hello</H1>" +"<img src=\"cid:memememe\">";
              part.setContent(htmlText,"text/html");
              multipartBody.addBodyPart(part);
              MimeBodyPart mbpBody = new MimeBodyPart();
              mbpBody.setContent(multipartBody);
              multipart1.addBodyPart(mbpBody);
              MimeBodyPart imagePart = new MimeBodyPart();
              DataSource fds = new FileDataSource(file);
              imagePart.setDataHandler(new DataHandler(fds));
              imagePart.setHeader("Content-ID","<"+"memememe"+">");
              imagePart.setDisposition("inline");
              multipart1.addBodyPart(imagePart);
              message.setContent(multipart1);
              Transport.send(message);
    You will have to make modifications so that the attchmetns are not embedded.

  • How to send html email notification in bpel

    hi gurus,
    i want to send html email notification from bpel.
    before, i already successful send html email with attachment, but when i send an email without attachment, then the body message will turn into a plain text.
    as i check from the email accepted, email with attachment will have a mime type "text/html" but if no attachment then it will be "text/plain"
    from the bpel configuration, by default the mime type already set to "text/html; charset=UTF-8", below is the sample configuration in my bpel process
    [quote]
    <copy>
                                    <from>string('text/html; charset=UTF-8')</from>
                                    <to variable="varNotificationReq"
                                        part="EmailPayload">
                                        <query>ns10:Content/ns10:MimeType</query>
                                    </to>
                                </copy>
    [/quote]
    i think this suppose to be a easy configuration, but i'm not sure whether i miss something in configuration the email process or this is a bugs in bpel.
    environment:
    linux
    jdev 11.1.1.6
    do u guys ever facing a same problem or have a solution to this ? please throw some light.
    thanks
    ===
    update, i found a temporary solutions.
    so i add a attachment from the process design, and then i change it from the source.
    [quote]
    <copy>
                                    <from>
                                        <literal>
                                            <Content xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">
                                                <MimeType xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">multipart/alternative</MimeType>
                                                <ContentBody xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">
                                                    <MultiPart xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">
                                                        <BodyPart xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">
                                                            <MimeType xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/>
                                                            <ContentBody xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/>
                                                            <BodyPartName xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/>
                                                        </BodyPart>                                            
                                                    </MultiPart>
                                                </ContentBody>
                                            </Content>
                                        </literal>
                                    </from>
                                    <to variable="varNotificationReq"
                                        part="EmailPayload">
                                        <query>ns10:Content</query>
                                    </to>
                                </copy>
    <copy>
                                    <from>string('text/html; charset=UTF-8')</from>
                                    <to variable="varNotificationReq"
                                        part="EmailPayload">
                                        <query>ns10:Content/ns10:ContentBody/ns10:MultiPart/ns10:BodyPart[1]/ns10:MimeType</query>
                                    </to>
                                </copy>
                                <copy>
                                    <from>string('your message')</from>
                                    <to variable="varNotificationReq"
                                        part="EmailPayload">
                                        <query>ns10:Content/ns10:ContentBody/ns10:MultiPart/ns10:BodyPart[1]/ns10:ContentBody</query>
                                    </to>
                                </copy>
    [/quote]
    make sure you put the mime type multipart/alternative into the email payload content. by default, when you add attachment, it will generate mime type multipart mixed automatically.
    if you don't change it to multipart/alternative, your email will show a attachment, but actually your email doesn't contain any attachment.
    and then for the message and mimetype make sure you have that ns10:bodypart, because this email already been set as a multipart email.
    when you add attachment, by default it will generate 2 body part, first one is for the body message and the second one is for the attachment. since i only want to use the body message only, then i have to erase the second bodypart
    with this workaround, i can send a html email without attachment perfectly.
    but i have to take note, when i updating the email process from process design, then the source will be generated again automatically, and the edited one will be replaced.
    thanks.

    Make sure you upload all of the images used in your email to a server you control. Then, change your image paths to point to those uploaded images with absolute links.
    You will get marked as spam if you attempt to send images as attachments to a large list of recipients and most email clients won't download images to begin with, so make sure your html email makes sense with broken pictures.
    CSS support is spotty across email clients, if you use css, make sure it's inline, not embedded in the <head> or externally linked in the <head>. Some email clients strip out the <head> section entirely.
    Basically, you need to design your html email as if you haven't moved out of the 90's yet, as far as web design is concerned, in order to get maximum cross client compatibility.
    Then, when you're ready, I would suggest using a service like www.icontact.com or www.constantcontact.com if your subscriber list is anywhere over 100 or so recipients.

  • How to send HTML as message body using SMTP

    I need to send HTML formatted emails. I used the Report Generation Toolkit to build my HTML document and make sure I had all of the formatting right. Then I modified the Save Report To File.vi to also give me the HTML text string on an output connector and I wire this string to the message input on the SMTP Email Send Message.vi.
    I receive the email OK, but all I see is the HTML code in the message body. What can I do to make sure that the email displays the message correctly.
    I use Outlook and I know it will receive and display HTML emails, I get them all the time.
    I would appreciate any help.

    Hi Dgw,
    it is similar. You must change message MINE content-type to "text/html" type. Because everyone document in email protocol have set MINE content-type. It is inforamtion for email servers and for email cients (Thunderbird, Outlook and etc.)
    For sendning mail with attachments you must use and modified "SMTP Send Multiple Attachments.vi" - if you can do backup of this VI and subVIs. Open Diagram of "SMTP Send Multiple Attachments.vi" after "SMTP Send Multiple
    Attachments Message.vi" and ther is VI "MIME Send Data Attachment.vi" - have control "MIME content-type" but code from NI don't use it.
    And like as my previous message, create new string control "MINE content-type" and take out this control to "main" Email VI.
    And embedd
    ed file you set up in control-cluster "attachments". I don't test it, but I mind thet must working :-)
    Have nice day
    JCC
    Attachments:
    email.jpg ‏70 KB

  • Fetching Dynamic email address from the HTML content sent in the email body

    Hi All,
    I have a scenario where in i have to send an html content via an email body . while doing so , i need to fetch the email address from the html content and send a mail to the specified email adrress in the html content .
    How to fetch the email address from the html content.
    Regards
    Vinay P.

    Hi ,
    Dynamic configuration means ...do i need to come up with a mapping which contains the  To,From,Subject fields & all...so that when i click on the mail package in mail adapter ...this  "To" email id will be fetched dynamically
    Regards
    Vinay P

  • I have 5 html pages that share a common header, footer, and sidebar. how do i use my nav bar to change the content of the body without duplicating a lot of code?

    i have 5 html pages that share a common header, footer, and sidebar. how do i use my nav bar to change the content of the body without duplicating a lot of code? thank you!

    i inherited the website. It’s for a non-profit and is not very
    sophisticated, and neither am I in webdesign. It currently has multiple
    pages that are identical except for that body section, so whenever i change
    the navigation (in the sidebar) I have to update every html page.  I want
    to have one basic page, and just call in the different body content based
    on the link the user selects from the nav bar. How can i do that using a
    script? i am using Dreamweaver.
    ~ in love and light ~
    Jeannie
    On Sat, Feb 7, 2015 at 4:07 AM, Ben Pleysier <[email protected]>

  • HTML Content in Email Notifications

    Hi
    I was wondering if HTML content is supported in BPM Email notifications. The html code in the BPM UI task email notification is coming as plain HTML in the email, can you please let me know if there is any flag that needs to be turned on to process the HTML code before the email is sent out?
    Thanks
    Sasi

    i think standard notification doesn't support this.

  • Sending HTML Mails using SO_DOCUMENT_SEND_API1

    Dear all,
    we were using SO_DOCUMENT_SEND_API1 to send plain text e-mail replies to participants of an incentive program. Now the customer wants to send HTML mails. Customer has provided HTML templates for the mails, and the text always is the same, only slight changes in regard to the particpants number occur. Has anybody ever performed sending HTML formated mails without using SmartForms?
    Thanks for your help!
    Kind Regards
    Chris

    Sure.. here is a sample program.
    report zrich_0002.
    data: maildata   like sodocchgi1.
    data: mailtxt    like solisti1 occurs 10 with header line.
    data: mailrec    like somlrec90 occurs 0  with header line.
    start-of-selection.
      clear:    maildata, mailtxt,  mailrec.
      refresh:  mailtxt, mailrec.
      perform build_text_message.
      perform build_receivers.
      perform send_mail_nodialog..
    *      Form  BUILD_TEXT_MESSAGE
    form build_text_message.
      maildata-obj_name = 'TEST'.
      maildata-obj_descr = 'Test Subject'.
      mailtxt  = '<html>'.
      append mailtxt.
      mailtxt  = '<head>'.
      append mailtxt.
      mailtxt  = '<title>Untitled Document</title>'.
      append mailtxt.
      mailtxt  = '<meta http-equiv="Content-Type" content="text/html;'.
      append mailtxt.
      mailtxt  = 'charset=iso-8859-1">'.
      append mailtxt.
      mailtxt  = '</head>'.
      append mailtxt.
      mailtxt  = '<body>'.
      append mailtxt.
      mailtxt  = '<div align="center"><em><font' .
      append mailtxt.
      mailtxt  = 'color="#0000FF" size="+7" face="Arial,'.
      append mailtxt.
      mailtxt  = 'Helvetica, sans-serif">THIS'.
      append mailtxt.
      mailtxt  = '  IS A TEST </font></em><font' .
      append mailtxt.
      mailtxt  = 'color="#0000FF" size="+7" face="Arial,'.
      append mailtxt.
      mailtxt  = 'Helvetica, sans-serif"></font>'.
      append mailtxt.
      mailtxt  = '</div>'.
      append mailtxt.
      mailtxt  = '</body>'.
      append mailtxt.
      mailtxt  = '</html>'.
      append mailtxt.
    endform.
    *      Form  BUILD_RECEIVERS
    form build_receivers.
    *  mailrec-receiver = '[email protected]'.
      mailrec-rec_type  = 'U'.
      append mailrec.
    endform.
    *      Form  SEND_MAIL_NODIALOG
    form send_mail_nodialog.
      call function 'SO_NEW_DOCUMENT_SEND_API1'
           exporting
                document_data              = maildata
                document_type              = 'HTM'
                put_in_outbox              = 'X'
           tables
                object_header              = mailtxt
                object_content             = mailtxt
                receivers                  = mailrec
           exceptions
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                others                     = 8.
      if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    endform.
    Regards,
    Rich Heilman

  • HTML content with images and links blocked

    Hello,
    I very much need some help here because my company needs to send out newsletters to our clients in HTML format soon and so far the email with HTML content is being blocked as spam while text content works fine. Specifically, whenever I add a link or an image in HTML content, the email doesn't go through. I tried sending in multipart format but it is also not sending HTML with images and links. Here is my attempt:
                                    props.setProperty("mail.transport.protocol", "smtp");
                                     props.setProperty("mail.host", "mail.server.com");
                                     props.setProperty("mail.user", "joeuser");
                                     Session mailSession = Session.getDefaultInstance(props, null);
                                     mailSession.setDebug(true);
                                     Transport transport = mailSession.getTransport();
                                     MimeMultipart mp = new MimeMultipart("alternative");
                                     MimeBodyPart htmlPart = new MimeBodyPart();
                                     MimeBodyPart textPart = new MimeBodyPart();
                                     textPart.setText("Just to make it multipart");
                                     htmlPart.setHeader("MIME-Version", "1.0");
                                     htmlPart.setHeader("Content-Type", htmlPart.getContentType());
                                     htmlPart.setContent(strHtmlMessage, "text/html");
                                     mp.addBodyPart(textPart);
                                     mp.addBodyPart(htmlPart);
                                     MimeMessage message = new MimeMessage(mailSession);
                                     message.setHeader("MIME-Version", "1.0");
                                     message.setHeader("Content-Type", mp.getContentType());
                                     message.setHeader("X-Mailer", "Recommend-It Mailer V2.03c02");
                                     message.setContent(mp);
                                     message.setSubject(strSubject);
                                     message.setFrom(new InternetAddress("[email protected]"));
                                     message.addRecipient(Message.RecipientType.TO,
                                             new InternetAddress("[email protected]"));
                                             transport.connect();
                                             transport.sendMessage(message,
                                             message.getRecipients(Message.RecipientType.TO));
                                     transport.close();This code is one of my numerous attempts to make HTML send images and links. Please, let me know if there is a workaround way to make JavaMail send HTML with links and images in the message body. Your help will be greatly appreciated.

    The JavaMail FAQ has information on creating HTML messages, including
    messages with both plain text and HTML. Did you find it?
    BTW, your code has many unnecessary statements, such as setting
    the Mime-Version header, which JavaMail will do for you, and setting
    the Content-Type header, which JavaMail does as a side-effect of the
    setContent or setText calls.
    Other than that, it looks like your code should be correctly creating a
    multipart/alternative message. If the recipient is still rejecting it you
    need to figure out what it is about the message that makes the recipient
    think it's spam. Can you send a similar message using another mailer?
    Can you send the message to a different recipient?

Maybe you are looking for