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?

Similar Messages

  • How to display html content with image in Adobe Flash and Flex mobile project?

    Hi,
      I have a html content with image in it. How to display it in Adobe Flash Builder and Flex mobile project? Which control needs to be used for this?

    Hello,
    The only current way is to use an iFrame, or if you only need some html tags you could use the Text Layout Framework.
    Here this is the iFrame approach:
    http://code.google.com/p/flex-iframe/
    If the swc do not work in Flex4 just use its ource code which works...
    ...it is basically based on this:
    http://www.deitte.com/archives/2008/07/dont_use_iframe.htm
    see also and vote, please:
    http://bugs.adobe.com/jira/browse/SDK-12291
    http://bugs.adobe.com/jira/browse/SDK-13740
    Regards
    Marc

  • Custom html file with pix and links as Mac desktop display?

    Hi, in Windows it is possible to select an html file to use as your desktop display...pictures, web links, and links to network and local folders, files, and applications can be written directly into the html page. It was actually really nice.
    How can this be done on a Mac?
    It would be great to have personal pictures, text (poems and to do lists) displayed as the desktop background...with links to files (inspirational .mov files, recently used files, even the html file for the desktop itself for quick changes), links to start applications, and links to favorite websites...all accessible from the desktop itself.
    Alternatively, would these links need to be placed in the dashboard or expose or ? Would the text over a background image in html need to be composited into a static image file?
    thanks

    I don't believe there is a way in the Mac world to specify anything but image files to be used as your desktop.
    I might suggest that you open the HTML fileof your choice in a browser, and take a screen shot of the output. Then you can assign that screen shot to be your desktop.
    Command-shift-4 will give you a crosshair cursor to drag around the area you wish to capture.

  • How do i send an html file exported from muse as email blast with images and live links?

    My question it:
    How do i send an html file exported from muse as email blast with images and live links?
    I have designed a "website" in adobe muse and exported it as an html file. I am not sure how to send my .html file in an email!
    Best,
    Nicole

    Unfortunately, the answer is, you don't. The requirements for HTML displayed in an e-mail reader are very different than those for HTML displayed in a browser. The output of Muse won't work as an HTML e-mail. You could upload the Muse site as a website and provide a link to it in an e-mail, but the HTML generated by Muse is not suitable for direct display by an e-mail program.

  • Setting html content with setContent() does never show images

    I've an application set sets dynamically generated html-content in a webview node by using the webengine.setContent() method. This generated html content uses image-tags.
    Here's the problem: the image is not displayed. I tried all variations (absolute url like "http://localhost/c:/test.png" or "file://c:/test.png", relative urls like "test.png" with png in jar-file).
    Anyone out there who has a workaround for me? I appreciate any comment.

    one non-working apple <img src="apple.png"> You loaded the page content with loadcontent, then inside the page content provided a relative url. This is likely an error.
    The question is, what is this url relative to?
    The answer is either likely undefined as no protocol was used to load the page content and so it can't be determined how to load the relative url resource.
    and two non-working peaches <img src="http://localhost/c:/peaches.png">
    You attempted to load content using the http protocol server on the localhost, but you have no such server on the host, so this cannot work.
    and a working remote image url <img src="http://docs.oracle.com/javafx/javafx/images/javafx-documentation.png">
    This works because you fully specified how to load the content by providing the protocol and valid resource reference.
    OK, so the question remains how do you images from the local drive?
    There are three options for this in the following code.
    package org.jewelsea.examples.webviewlocal;
    import javafx.application.Application;
    import javafx.beans.value.*;
    import javafx.scene.Scene;
    import javafx.scene.layout.FlowPane;
    import javafx.scene.web.WebView;
    import javafx.stage.Stage;
    /** Example of a webview loading resources from the file system. */
    public class WebViewLocal extends Application {
      public static void main(String[] args) throws Exception {
    //    URL.setURLStreamHandlerFactory(new HandlerFactory());
        launch(args);
      public void start(final Stage stage) throws Exception {
        final FlowPane layout = new FlowPane();
        WebView webView = new WebView();
        webView.getEngine().load("file:///C:\\dev\\gettingstarted\\timeforgotten.html");
    //    webView.getEngine().load("jar:file:///C:\\dev\\javafx\\JavaFXidea\\out\\artifacts\\JavaFXidea_jar\\JavaFXidea.jar!/org/jewelsea/examples/webviewlocal/timeforgotten.html");
    //    webView.getEngine().load("resource:///org/jewelsea/examples/webviewlocal/timeforgotten.html");
        webView.getEngine().getLoadWorker().exceptionProperty().addListener(new ChangeListener<Throwable>() {
          @Override public void changed(ObservableValue<? extends Throwable> observableValue, Throwable oldThrowable, Throwable newThrowable) {
            System.out.println("Load exception: " + newThrowable);
        // layout the scene.
        layout.getChildren().addAll(webView);
        Scene scene = new Scene(layout, 1000, 600);
        webView.prefWidthProperty().bind(scene.widthProperty());
        webView.prefHeightProperty().bind(scene.heightProperty());
        stage.setScene(scene);
        stage.show();
    }which loads the following html file:
    <html>
    <head>
      <style type="text/css">p { color: sienna; font-size: 20px; text-align: center; }</style>
    </head>
    <body bgcolor="cornsilk">
    <p><em>
        <br/>
        On either side the river lie,<br/>
        Long fields of barley and of rye,<br/>
        And through the fields a road runs by,<br/>
        To many towered Camelot.
    </em></p>
    <p><img src="camelot.jpg"/></p>
    </body>
    </html>If you want to test this example the camelot.jpg image is downloadable from http://www.timelessmyths.com/arthurian/gallery/camelot.jpg.
    Option 1: The file:// protocol for lookup from the filesystem.
    This is the most straight-forward as it is just based on standard html layout in the filesystem - just place your html and it's relative referenced images somewhere in your filesystem in locations relative to each other - if your browser loads it properly, then your webengine will to if you give it the right file:// path.
    In the case of file:///C:\\dev\\gettingstarted\\timeforgotten.html, timeforgotten.html is placed in c:\dev\gettingstarted and camelot.jpg image is placed in the same directory.
    Option 2: The jar:file:// protocol for lookup from a jar hosted on the filesystem.
    This makes use of the http://docs.oracle.com/javase/7/docs/api/java/net/JarURLConnection.html to find your resources.
    If your application resources are packaged in a jar file (could be the same jar file as your main application class) then you can reference the jar file through the file protocol, then pick out the resources packaged in the jar file via their relative paths.
    Option 3: The resource:// protocol for lookup based on the classpath.
    This type of resource lookup is the one most Java programmers are familiar with - a classloader is used to load a resource. The pattern is widely used in web application frameworks on the server. But usually the means to do this is via a classloader.getResource() call, not via a URL.
    Java does not, by default, have a URL protocol handler for looking up resources on the classpath, so if you want to do this, it is necessary to create your own protocol and install it.
    The installation function is the commented out line: // URL.setURLStreamHandlerFactory(new HandlerFactory());
    It is a system wide call for the VM and should be called (just once) before any URL Connections are established.
    To get this to work I used a resource handler from http://www.arakhne.org/arakhneVmutils/index.html which included the following classes:
      java.org.arakhne.vmutil.resource.Handler
      java.org.arakhne.vmutil.resource.HandlerFactory
      java.org.arakhne.vmutil.resource.URLConnection
      java.org.arakhne.vmutil.ClassLoaderFinder
      java.org.arakhne.vmutil.Resources
      java.org.arakhne.vmutil.ResourceNotFoundException
      java.org.arakhne.vmutil.URISchemeType
      java.org.arakhne.vmutil.URLHandlerUtilDetails on how all this works are in http://java.sun.com/developer/onlineTraining/protocolhandlers/ which defines "A New Era for Java Protocol Handlers" by defining a URL handler extension mechanism which is hardly ever used.
    As a final note to my way overly long forum post, when the WebEngine doesn't process the urls sometimes you can get info on what went wrong via the monitoring the loadWorker's exception property, but sometimes I was able to get more complete stack traces by trying to open a connection on a URL to see if I had got the URL correct - for example:
        URL url = new URL("jar:file:///C:\\dev\\javafx\\JavaFXidea\\out\\artifacts\\JavaFXidea_jar!/org/jewelsea/examples/webviewlocal/timeforgotten.html");
        url.openConnection();Anyway, just using the file:// protocol in webEngine.load() will probably accomplish what you need.
    Note that if it is a webstart or browser embedded app, then you'll need to sign it if you want to access the local file system.

  • How to save HTML file with images present in the server to local machine

    Hi all
    In my application i have a option for the user to save HTML files with images present in the server. The HTML file is getting saved but the images are not being saved.
    The code i am using is below :-
    l
                        File fname = new File(filePath);
                        if(!fname.exists())                return;
                        FileInputStream istr = null;
                        OutputStream ostr = null;
                        response.setContentType("application/"+format);
                        response.setHeader("Content-Disposition", "attachment; filename=\"" + fname.getName() + "\";");
                        try { 
                             istr = new FileInputStream(fname);
                             ostr = response.getOutputStream();
                             int curByte=-1;
                             while( (curByte=istr.read()) !=-1)
                                  ostr.write(curByte);
                             ostr.flush();
    Can anyone suggest what i need to do
    regards

    The client should probably parse the html that comes down, and look for <img> links, and request those of the server as well.

  • Html content to image saver

    Hi,
    how to convert html content to image(using image saver) help of BLS Action Block
    Thanks
    Ramesh

    Ramesh,
    I'm not sure your question is very clear. Why are you trying to convert HTML to an image?
    I can assume that your experience with xMII is very limited....?
    Some recommedations are as follows:
    1) Take the xMII training...it's very helpful!
    2) Read the xMII Help guide...it comes packaged with the xMII install and can be accessed from the xMII Portal page on the top right corner of the page.
    3) Reference the xMII Wiki for additional info:  <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/wiki?path=/display/xmii/main&">xmii WIKI...Click Here!</a>
    And as always the best way to see how something works is to TRY it out. Read the help, then post in this community and explain what you have done and tried so that we can help out with what else you can try.
    Questions which ask us to do your work are not very productive for you, or the community as a whole.

  • Question regarding image and links tag

    Hi. Im new to podcasting and have just had my first podcast excepted on itunes.
    Im using garageband.com to store my audio file and copy & pasting the address into itunes to submit it. (http://www.garageband.com/user/wabel/podcast/main.xml)
    What i dont understand is adding an cd cover image and links to a web site.
    I asume its sumular to html, where you type the code with link or image, but where? I cant edit within the above link!
    Please help.

    The "code" for images and links goes into the xml file.
    <?xml version="1.0" encoding="UTF-8"?>
    <rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
    <channel>
    <ttl>60</ttl>
    <title></title>
    <link></link>
    <language></language>
    <copyright></copyright>
    <itunes:subtitle></itunes:subtitle>
    <itunes:author></itunes:author>
    <itunes:summary></itunes:summary>
    <itunes:owner>
    <itunes:name>John Doe</itunes:name>
    <itunes:email>[email protected]</itunes:email>
    </itunes:owner>
    <itunes:image href="http://example.com/podcasts/everything/AllAboutEverything.jpg" />
    <itunes:category text=" ">
    <itunes:category text=" "/>
    </itunes:category>
    <item>
    <title></title>
    <itunes:author></itunes:author>
    <itunes:subtitle></itunes:subtitle>
    <itunes:summary></itunes:summary>
    <enclosure url=" " length=" " type=" " />
    <guid></guid>
    <pubDate></pubDate>
    <itunes:duration></itunes:duration>
    <itunes:keywords></itunes:keywords>
    </item>
    </channel
    </rss>

  • Keep track of images and links in a datafile

    Hi,
    I have set up replication between my source and destination server. How do images and contents linked in a webpage section replicate?
    I think images and content reffred should be replicated seperately, as a datafile doesnot have a refrence telling images reffered should be moved.
    Now the question is how to move Images and contents that are linked in the webpage along with datafiles.
    One solution is to use SiteStudio section replication. If we use that how to make sure this goes through a work flow and then gets replicated?
    your inputs willl be usefull

    This seems somewhat like an architecture question. Let's assume you have two servers (I'll call them staging and production). You have set the Site Studio Migration Utility to automatically replicate content associated with your site from staging to production. Now in our example, on staging there is a datafile with various images and links to native content that users regularly update. You have a workflow layer applied to all datafiles of your site so that content isn't migrated into production until it has been workflow approved. I'm assuming this is how you are set up (since this is a commonly recommended architecture).
    Now back to the datafile. I'm assuming the images in the datafile (as well as any linked native content) have site specific metadata applied to them, so that the Site Studio Migration utility replicates them into production just like migrates other areas of your site. If that is the case, then it is the responsibility of the workflow approver to verify that all images (and document links) look right before approving the content for auto migration.
    Unfortunately, you may run into a situation like the following... You have a page that lists sales figures every month, and uses an image to visualize those sales figures. You already have a datafile in production for February as well as the associated February graphic. You create an updated sales figure datafile for March, as well as an updated associated image for March. The image migrates into production automatically, before the updated datafile referencing the updated image clears workflow. Your February sales figure page could potentially have the March sales image inside of it. This is a potential problem since there is no concept of a "group approval" for all elements that make up the contents within a datafile. You could add a layer of workflow to all native content and images, but then you'd have to be fairly certain that you were synched up properly. You could also manually migrate, but I can see where this would not be ideal either. Unfortunately, there is no easy answer.

  • Is Acrobat Pro right for us. We have an Employee Handbook that needs editing. Some is current pdf, some from an older version. Want to get all into one handbook, have the table of contents automatically adjust and link to specific pages from the ToC.

    Is Acrobat Pro right for us. We have an Employee Handbook that needs editing. Some is current pdf, some from an older version. Want to get all into one handbook, have the table of contents automatically adjust and link to specific pages from the ToC.

    You can download the trial version (http://helpx.adobe.com/acrobat/kb/acrobat-downloads.html) to convert the PDF back to WORD if you do not have the original. The conversion may not be perfect, but it is typically better than starting from scratch. You may be lucky and get a good result. You might check the settings (in the save screen) to try retain format versus retain text flow. The format version can be a pain to edit since it creates a bunch of text boxes. The flow version may require you to reformat in WORD, but you likely would want to do that anyway.

  • I have created two related books in Lightroom 5 (Volumes 1 and 2) but my balance of page numbers is off. So I'd like to take some pages out of one book (complete with images) and paste them into the other. Is this possible?

    I have created two related Blurb books in Lightroom 5 (Volumes 1 and 2) but my balance of page numbers is off. So I'd like to take some pages out of one book (complete with images) and paste them into the other. Is this possible?

    Can you zip up a few of your GoPro images, upload them to dropbox.com and post a share link, here, so others can experiment with them, or do you mean this issue is global to all camera models?

  • How can servlet return the output as html content with drawing picture?

    Does anybody know how can a servlet return the output as html content with drawing picture?
    The drawing picture is drawn at runtime by the servlet.

    Thanks, BalusC.
    But I am not sure if I understand your reply fully.
    From my understanding, you are telling me to first generate a html from a servlet with the image <IMG> tag pointing to a servlet which will be responsible to generate an image?
    For example, <IMG SRC="http://myserver/servlet/testservlet">
    Could you confirm this?

  • Windows.ApplicationModel.DataTransfer. How share image and link in same post ?

    How share image and link in same post  ?

    You can
    share a link and share an image (as an image or
    as a file), but logically speaking all of the data types shared are considered different views of the same thing. The share target will pull out the best format for its target and leave the rest. The share source cannot tell the target how to interpret
    the data.
    See
    Choosing data formats and file types.
    If you want to combine multiple data types in one view then you can combine them in an HTML page. See
    How to share HTML

  • How to create labeled table of Content with expand and collapse

    Hi All,
    Can somebody help me how to create labeled table of Content with expand and collapse as example given below:
    User1
    Template1
    Template2
    User2
    +
    User3
    Template1
    Template2
    Like when we see expand (+) and collapse (-) button when we click on 'about this page' link.
    Thanks
    Bhupendra

    Hi,
    Tou can use Table inside table to show the details this way but I'm not sure about Expand/Collapse.
    Expand/Collapse are part of HGRID.
    I think we can develop this functionality with little manipulation.
    Regards,
    Reetesh Sharma
    Edited by: Reetesh Sharma on Jun 28, 2010 4:56 AM

  • CSS Rollover Menu with Images and Current Page Indicator

    Hello.
    I have found a very interesting video here: http://www.youtube.com/watch?v=vv8cRYGCvIY about creating a CSS Rollover Menu with Images and Current Page Indicator (I tested it and it is working fine).
    I have a web site with 15 pages based on a template and I want to use that video sample to do the same thing on my web site.
    Please tell me if I can use the sample from the link above to do that.
    What should I change in the css file (what new class should I make) to make this work on a web site based on a template  ?
    Thank You !

    I don't know about that video tutorial but a sitewide persistent menu indicator ('you are here' highlighting) is very simple to do with CSS classes.
    Details and code examples below:
    http://alt-web.com/Articles/Persistent-Page-Indicator.shtml
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

Maybe you are looking for

  • C4440 scan error Operation could not be completed (error 0x00000015​). The device is not ready.

    I have updated, restarted, etc. Sometimes when scanning I do not get this message, but more often I do. When scanning I receive the following message: Error message when scanning "Operation could not be completed (error 0x00000015). The device is not

  • TC not backing up both of my internal hard drives.

    So I am having a frustrating issue with my TC setup.  I have a mac mini that has two internal hard drives each one being 500 GB.  My TC drive is 1 TB.  When I go to time machine preferences and click options I do not have any of my internal drives in

  • Target special G/L indicator

    Hi All, Can you give me cinfiguration document for how to create for target special G/L indicator. Regards, Thiru

  • Top 5 and bottom 5 selling products

    My source table contains Book_id Quantity Selling_date My problem is to find out top and bottom 5 selling books for a particular year. For example, For year 2010, Top_5 Bottom_5 b1 b2 b6 b8 In this way I want to get output for watever year I want. Wa

  • How to unlock and remove comments in Adobe Reader?

    A while ago I left a comment in an adobe file and now I want to change it or remove it. The problem is that I can't do anything to the comment, because it is locked and it seems that I don't have the permission to do that. I run Win 7, 64bit. When I