Sending HTML page as attachment

Hi, I have a specific requirement wherein the HTML page I display at one screen is to be sent as an email. How do I attach such an HTML page for which is nowhere saved in the memory to read it from?

You use a URLDataSource if the screen is displayed by accessing
a particular URL.

Similar Messages

  • How to send HTML page via an email

    Hi..
    I wanna send HTML page with images via an email, it should not go as an attachment.
    Is there any Tool or Software available to send HTML Pages via email.
    i just wanna send my advertisement as a HTML page via email
    So plz. help me out

    Java Message Service (JMS) For more info u can visite http://java.sun.com/products/jms/tutorial/
    It is usefull only when u r using some Application servers like WebLogic, WebSpeher, or JBoss
    Bye

  • Embedding HTML page as attachment

    I am sending a mail in html format. This HTML page contains some images and some links. Link in the html page refers to another html page. When clicked on this link, this referred html page should be opened in a browser window.(Html link cannot be web URL like http://...) . Inorder to do this I have embedded the images and html page with my mail. But when the link is clicked on the html, nothing is happening.(I can save the referred HTML page by selecting Save Attachments menu. That means the html page is available with mail) . How can i refer the attached html page? Please help

    I guess you need to refer it using the cid:##### where ##### is some content id, as reference and use the same id as Content-ID: header for your attached html page.
    check RFC2111 at http://www.ietf.org/rfc/rfc2111.txt
    The following message points to another message (hopefully still in
    the recipient's message store).
    From: [email protected]
    To: [email protected]
    Subject: Here's how to do it
    Content-type: text/html; charset=usascii
    ... The items in my
    previous message, shows how the approach you propose can be
    used to accomplish ...

  • How to send html page in outlook wihtout gibberish

    i have html page that i tried to send in outlook with send web page by email
    the problem is it add the following thing before the html:
    ן»¿
    the questions are:
    from where does it come from? and how to fixed it so it does not show?

    thank you for the answer but saving it as ansi or unicode make things worse and in that encoding
    it is not possible to see the page
    the page is mainly photos some text and links
    is there any other
    possibility that cause this or it is only encoding of the page? 

  • Send html page (with images) using sockets

    I am trying to implement http and am coding this using sockets. So it is a simple client-server set up where the browser queries my server for a webpage and it should be shown. The html itself is fine, but I can't get any of the images to show up! All of my messages give me a status "200 OK" for the images, so I cant understand what my problem is!
    Also, is the status and header lines supposed to be shown in the browser? I didnt think so but it keeps showing up when I query a webpage.
    Please help!
    import java.io.* ;
    import java.net.* ;
    import java.util.* ;
    public final class WebServer
         public static void main(String argv[]) throws Exception
              // Set the port number.
              int port = 8888;
              // Establish the listen socket.
              ServerSocket ssocket = new ServerSocket(port);
              // Establish client socket
              Socket csocket = null;
              // Process HTTP service requests in an infinite loop.
              while (true)
                   // Listen for a TCP connection request.
                   // (note: this blocks until connection is made)
                   csocket = ssocket.accept();     
                   // Construct an object to process the HTTP request message.
                   HttpRequest request = new HttpRequest(csocket);
                   // Create a new thread to process the request.
                   Thread thread = new Thread(request);
                   // Start the thread.
                   thread.start();
    final class HttpRequest implements Runnable
         final static String CRLF = "\r\n";
         Socket socket;
         // Constructor
         public HttpRequest(Socket socket) throws Exception
              this.socket = socket;
         // Implement the run() method of the Runnable interface.
         public void run()
              try
                   processRequest();
              catch (Exception e)
                   System.out.println(e);
         private static void sendBytes(FileInputStream fis, OutputStream os)
         throws Exception
            // Construct a 1K buffer to hold bytes on their way to the socket.
            byte[] buffer = new byte[1024];
            int bytes = 0;
           // Copy requested file into the socket's output stream.
           while((bytes = fis.read(buffer)) != -1 ) {
              os.write(buffer, 0, bytes);
              os.flush();
         private static String contentType(String fileName)
              fileName = fileName.toLowerCase();
              if(fileName.endsWith(".htm") || fileName.endsWith(".html")) {
                   return "text/html";
              if(fileName.endsWith(".jpg") || fileName.endsWith(".jpeg") ) {
                   return "image/jpeg";
              if(fileName.endsWith(".gif")) {
                   return "image/gif";
              return "application/octet-stream";
         private void processRequest() throws Exception
              // Get a reference to the socket's input and output streams.
              InputStream is = socket.getInputStream();
              DataOutputStream os = new DataOutputStream(socket.getOutputStream());
              // Set up input stream filters.
              InputStreamReader ir = new InputStreamReader(is);
              BufferedReader br = new BufferedReader(ir);
              // Get the request line of the HTTP request message.
              String requestLine = br.readLine();
              // Display the request line.
              System.out.println();
              System.out.println(requestLine);
              // Get and display the header lines.
              String headerLine = null;
              while ((headerLine = br.readLine()).length() != 0)
                   System.out.println(headerLine);
              // Extract the filename from the request line.
              StringTokenizer tokens = new StringTokenizer(requestLine);
              tokens.nextToken();  // skip over the method, which should be "GET"
              String fileName = tokens.nextToken();
              // Prepend a "." so that file request is within the current directory.
              fileName = "C:\\CSM\\Networking\\Project1" + fileName;
              // Open the requested file.
              FileInputStream fis = null;
              boolean fileExists = true;
              try {
                   fis = new FileInputStream(fileName);
              } catch (FileNotFoundException e) {
              fileExists = false;
              // Construct the response message.
              String statusLine = null;
              String contentTypeLine = null;
              String entityBody = null;
              if (fileExists) {
              statusLine = "200 OK" + CRLF;
              contentTypeLine = "Content-type: " +
                   contentType( fileName ) + CRLF
                   + "Content-length: " + fis.available() + CRLF;
              else {
              statusLine = "404 Not Found" + CRLF;
              contentTypeLine = "Content-type: text/html" + CRLF;
              entityBody = "<HTML>" +
                   "<HEAD><TITLE>Not Found</TITLE></HEAD>" +
                   "<BODY>Not Found</BODY></HTML>";
              // Send the status line.
              os.writeBytes(statusLine);
              System.out.println(statusLine);
              // Send the content type line.
              os.writeBytes(contentTypeLine);
              System.out.println(contentTypeLine);
              // Send a blank line to indicate the end of the header lines.
              os.writeBytes(CRLF);
              // Send the entity body.
              if (fileExists)     
                   sendBytes(fis, os);
                   fis.close();
              // file does not exist
                     else
                   os.writeBytes(entityBody);
              // Close streams and socket.
              os.flush();
              os.close();
              br.close();
              socket.close();
    }

    ok. i figured it out. STUPID mistake. i forgot to include "HTTP/1.1" in my status line!!!

  • How do i send an html page in java mail

    hi everyone, i have an problem while sending html page in my java mail application.Actually it's sending the html page correctly but the thing is it doesn't display the gif files . why so ? can anyone help me. i think its b'coz of the path problem.
    My requirement is like this :
    I would like to send an html page to some [email protected] from my local system . for that i have written one mail application which will build an html page which is also having some gif files. And these gif files are located in my local system. when i sent to some xyz user it's not displaying the gif files . How should i give the path for that gif files. pls help me regarding this. This is Urgent.
    Thanx in advance.
    by
    jjjavac

    hi , here with i have attached my program which will work fine . What u have to do is u have to specify ur smtp host address. from address and to address. And if u want to embedd the gif file u have to specify the gif file name. It will work only in outlook and hotmail. if u have anyother doubt let me know.
    import java.io.*;
    import java.util.Properties;
    import java.util.Date;
    import javax.mail.*;
    import javax.activation.*;
    import javax.mail.internet.*;
    import java.sql.*;
    import java.text.*;
    * @author Jeevan
    public class EmbeddingGif {
         StringBuffer sb = new StringBuffer();
         String line;
    public static void main(String[] argv) {
              new EmbeddingGif (argv);
    public EmbeddingGif (String[] argv) {
              String to, subject = null, from = "[email protected]",
              cc = null, bcc = null, url = null;
    //     String mailhost = null;
              String mailhost = "10.1.0.106";                    // SMTP host address
              String mailer = "SendHtmlMail";
              String protocol = "imap", host = null, user = "jeevan", password = "jeevan";
              String record = "g:/rbs/web-inf/classes/emailstore";     // name of folder in which to record mail
              boolean debug = false;
              BufferedReader in = null;
              int optind;
         for (optind = 0; optind < argv.length; optind++) {
         if (argv[optind].equals("-T")) {
              protocol = argv[++optind];
         } else if (argv[optind].equals("-H")) {
              host = argv[++optind];
         } else if (argv[optind].equals("-U")) {
              user = argv[++optind];
         } else if (argv[optind].equals("-P")) {
              password = argv[++optind];
         } else if (argv[optind].equals("-M")) {
              mailhost = argv[++optind];
         } else if (argv[optind].equals("-f")) {
              record = argv[++optind];
         } else if (argv[optind].equals("-s")) {
              subject = argv[++optind];
         } else if (argv[optind].equals("-o")) { // originator
              from = argv[++optind];
         } else if (argv[optind].equals("-c")) {
              cc = argv[++optind];
         } else if (argv[optind].equals("-b")) {
              bcc = argv[++optind];
         } else if (argv[optind].equals("-L")) {
              url = argv[++optind];
         } else if (argv[optind].equals("-d")) {
              debug = true;
         } else if (argv[optind].equals("--")) {
              optind++;
              break;
         } else if (argv[optind].startsWith("-")) {
              System.out.println(
    "Usage: SendHtmlMail [[-L store-url] | [-T prot] [-H host] [-U user] [-P passwd]]");
              System.out.println(
    "\t[-s subject] [-o from-address] [-c cc-addresses] [-b bcc-addresses]");
              System.out.println(
    "\t[-f record-mailbox] [-M transport-host] [-d] [address]");
              System.exit(1);
         } else {
              break;
         try {
         if (optind < argv.length) {
              // XXX - concatenate all remaining arguments
              to = argv[optind];
              System.out.println("To: " + to);
         } else {
              System.out.print("To: ");
              System.out.flush();
    //          to = in.readLine();
              to = "[email protected]";
         if (subject == null) {
              System.out.print("Subject: ");
              System.out.flush();
    //          subject = in.readLine();
              subject = "New Bill @ " + new Date ();
         } else {
              System.out.println("Subject: " + subject);
         Properties props = System.getProperties();
         // XXX - could use Session.getTransport() and Transport.connect()
         // XXX - assume we're using SMTP
              System.out.println("mailhost :"+mailhost);
              System.out.println("from :"+from);
              System.out.println("to :"+to);
              System.out.println("cc :"+cc);
              System.out.println("subject :"+subject);
              System.out.println("bcc :"+bcc);
              System.out.println("url :"+url);
         if (mailhost != null)
              props.put("mail.smtp.host", mailhost);
         // Get a Session object
         Session session = Session.getDefaultInstance (props, null);
         if (debug)
              session.setDebug (true);
         // construct the message
         Message msg = new MimeMessage(session);
         if (from != null)
              msg.setFrom(new InternetAddress(from));
         else
              msg.setFrom();
         msg.setRecipients(Message.RecipientType.TO,
                             InternetAddress.parse(to, false));
         if (cc != null)
              msg.setRecipients(Message.RecipientType.CC,
                             InternetAddress.parse(cc, false));
         if (bcc != null)
              msg.setRecipients(Message.RecipientType.BCC,
                             InternetAddress.parse(bcc, false));
         msg.setSubject(subject);
         collect(in, msg);
    //     msg.setHeader("X-Mailer", mailer);
    //     msg.setSentDate(new Date());
         // send the thing off
    //     Transport.send(msg);
    //     System.out.println("\nMail was sent successfully.");
         } catch (Exception e) {
         e.printStackTrace();
    public void collect(BufferedReader in, Message msg)     throws MessagingException, IOException {
                        BodyPart bp1=new MimeBodyPart();
                        String html="<H1>Hello from Jeevan</H1>";
                        html=html+"<img src=cid:mickey>";
                        bp1.setContent(html,"text/html");
                        MimeMultipart mp=new MimeMultipart("related");
                        mp.setSubType("related");
                        mp.addBodyPart(bp1);
                        BodyPart bp2=new MimeBodyPart();
                        DataSource source=new FileDataSource("fss.gif");
                        bp2.setDataHandler(new DataHandler(source));
                        bp2.setHeader("discrete-type","image");
                        bp2.setHeader("Content-ID","mickey");
                        mp.addBodyPart(bp2);
                        msg.setContent(mp);
                        Transport.send(msg);
         System.out.println("\nMail was sent successfully.");
    //                    msg.setDataHandler(new DataHandler(     new ByteArrayDataSource(sb.toString(), "text/html")));                                        

  • 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 inline HTML page in mail(not as attachment)

    Hi,
    I am using JavaMail to send details to users using text mail. Its working successfully. But now i have to send the details on mails that will contain HTML page (not as attachment but as inline HTML page containing text) and details in it. Plz help me. Its urgent.
    Thanks in advance,
    Devom

    Set the contentType to "text/html" and send away.
    (If you need both text and html you will need to make a multi-part message), this is covered in the FAQ.
    http://java.sun.com/products/javamail/FAQ.html
    travis (at) overwrittenstack.com

  • Sending XML to an HTML page in AS3

    I'm working on an a Flex 3 application to generate XML to use in Fusion Charts Free.
    So that the user can preview the chart, I'm currently sending the XML to an HTML page with runs the chart SWF using navigateToURL with the XML appended to the query string. The HTML page captures the query string with Javascript and supplies the XML to the chart.
    <script type="text/javascript">
       var xmlstring = getParameterByName('xml');
       var chart = new FusionCharts("FCF_Column2D.swf", "ChartId", "900", "600");
       chart.setDataXML(xmlstring);   
       chart.render("chartdiv");
       function getParameterByName(name) {
            var match = RegExp('[?&]' + name + '=([^&]*)')
                         .exec(window.location.search);
            return match && decodeURIComponent(match[1].replace(/\+/g, ' ')); 
    </script>
    This works fine in Firefox but I have problems with IE - the maxium URL length limits the amount of data, and IE9 removes the query string if in protected mode, and also requires it to be URL encoded. I try to get round this with the actionscript below.
    var pageurl:String = chartpage + ".html";
    var appName:String = ExternalInterface.call( "function getAppName(){ return navigator.appName; }" );
    var agentName:String = ExternalInterface.call( "function getAppName(){ return navigator.userAgent; }" );
    var qs:String = qxml;
    // IE cannot cope with more than 2083 chars in URL
    // IE9 requires escaping and needs to be not in protected mode
    if (appName == "Microsoft Internet Explorer")
       if (agentName.indexOf("MSIE 9") > -1)
        qs = encodeURI("?xml="+qxml);
        if (qs.length > 2000)
        Alert.show('Data is more than 2000 bytes, too much to pass to Internet Explorer on the query string. Choose less data or use a different browser.', 'Fusion Chart Generator', mx.controls.Alert.OK);
       else
        var urlRequestIE:URLRequest = new URLRequest(pageurl+qs);
        navigateToURL(urlRequestIE,"_blank");
    else
      var urlRequest:URLRequest = new URLRequest(pageurl+"?xml="+qxml);
      navigateToURL(urlRequest,"_blank");
    Is there a better way of doing this?
    Thanks
    Richard

    It appears that I am still doing something wrong. I've attached the flash, but here is the code based on my understanding of how to update it:
    import flash.net.URLRequest;
    import flash.net.navigateToURL;
    dvds.addEventListener(MouseEvent.CLICK,navigate1);
    var nav1:String="http://bikepaparazzi.com"; navigate1(e:MouseEvent):void {
    function
    navigateToURL(new URLRequest(nav1),"_self");
    proconvention.addEventListener(MouseEvent.CLICK,navigate2);
    var nav2:String="http://proconvention.com"; navigate2(e:MouseEvent):void {
    function
    navigateToURL(new URLRequest(nav2),"_self");
    advertise.addEventListener(MouseEvent.CLICK,navigate3);
    var nav3:String="http://bikepaparazzi.com"; navigate3(e:MouseEvent):void {
    function
    navigateToURL(new URLRequest(nav3),"_self");
    tee.addEventListener(MouseEvent.CLICK,navigate4);
    var nav4:String="http://bikepaparazzi.com"; navigate4(e:MouseEvent):void {
    function
    navigateToURL(new URLRequest(nav4),"_self");
    proconvention.addEventListener(MouseEvent.CLICK,navigate5);
    var nav5:String="http://bikepaparazzi.com"; navigate5(e:MouseEvent):void {
    function
    navigateToURL(new URLRequest(nav5),"_self");

  • Please help to send an email with html page in body

    I need an html page on the body of an email to send an email blast to our customers.

    HTML Emails can be a bit tricky. You can design them in Dreamweaver, but you really shouldn't send mass email through your personal email account (or your company account). That could get you blacklisted by corporate spam filters and make your email addresses pretty much useless.
    For mass email campaigns (over a few hundred email addresses) I use http://www.icontact.com.
    You can build the email right through their site (without DW) or you can import your html from DW to their service.
    Some things to keep in mind with HTML email...
    1. Use absolute links to images and files on a server you control
    2. Use a limited amount of inline css (no external or embedded css)
    3. Use table based layouts, css support is spotty at best with email clients
    4. The <head> will be stripped from a number of email clients, don't rely on anything between the <head> tags making it to your recipients
    5. Don't use an image-only email. HTML text is very important to keep it from being labeled spam, make the images secondary to the message, many email clients will not download images without the user's say-so
    6. Include an opt-out link so people can get off your list
    There are more things to watch out for, but those are the big ones. Here is some more good info: http://alt-web.com/Articles/HTML-Emails.shtml

  • Send HTML as attachment in email in Stored Procedure

    Hi Guys,
    I am writing a stored procedure to send HTML attachment. Below is my code but no html attachment sent in mail. Kindly advise.
    USE [CarsemERP]
    GO
    /****** Object: StoredProcedure [dbo].[DBA_CarsemERP_SQLBlocks] Script Date: 04/01/2015 15:14:15 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- =============================================
    -- Author: <THARMENDRAN>
    -- Create date: <2014FEB21>
    -- Description: TO CHECK ANY LOCKS MORE THN 20 SEC IN SQL SERVER
    -- =============================================
    ALTER PROCEDURE [dbo].[DBA_CarsemERP_SQLBlocks]
    AS
    BEGIN
    DECLARE @iCnt As Int
    DECLARE @ICnt2 As Int
    DECLARE @SendEmail AS VARCHAR(3)
    DECLARE @Temp_DetailReq1 TABLE (
    idx smallint Primary Key IDENTITY(1,1),
    DBName varchar(30), RequestId Int, BlockingId Int, BlockedObjectName varchar(30),LockType varchar(30), RequestingText varchar(max), BlockingText varchar(max),
    LoginName varchar (30), HostName varchar (30))
    DECLARE @Temp_DetailReq2 TABLE (
    idx smallint Primary Key IDENTITY(1,1),
    DBName varchar(30), RequestId Int, BlockingId Int, BlockedObjectName varchar(30),LockType varchar(30), RequestingText varchar(max), BlockingText varchar(max),
    LoginName varchar (30), HostName varchar (30))
    SET @SendEmail = 'NO'
    SELECT @iCnt= COUNT(*) FROM DBA_SQLBlocksViewTharmen
    IF @iCnt > 0
    BEGIN
    Insert Into @Temp_DetailReq1
    Select DBName, request_session_id, blocking_session_id, BlockedObjectName,resource_type, RequestingText, BlockingTest, LoginName, HostName From DBA_SQLBlocksViewTharmen
    END
    WAITFOR DELAY '00:00:20'
    select @iCnt2= COUNT(*) FROM DBA_SQLBlocksViewTharmen
    IF @iCnt2 > 0
    BEGIN
    DECLARE @columnHeaders NVARCHAR(MAX)
    DECLARE @tableHTML NVARCHAR(MAX)
    DECLARE @body NVARCHAR(MAX)
    Insert Into @Temp_DetailReq2
    Select DBName, request_session_id, blocking_session_id, BlockedObjectName,resource_type, RequestingText, BlockingTest, LoginName, HostName From DBA_SQLBlocksViewTharmen
    SET @SendEmail = 'YES'
    BEGIN
    SET @columnHeaders = 'DBName</th><th>RequestId</th><th>BlockingId</th><th>BlockedObjectName</th><th>LockType</th><th>RequestingText</th><th>BlockingText</th><th>LoginName</th><th>HostName'
    set @tableHTML =
    '<div><b>There is blocking in VERPSVR02-02.</b></div><br>' + -- This is the bold text at the top of your email
    '<table border="0" cellpadding="5"><font face="Calibri" size=2>' +
    '<tr><th>' + @columnHeaders + '</th></tr>' +
    convert(nvarchar(max),
    select td = [DBName], '', -- Here we put the column names
    td = [RequestId], '',
    td = [BlockingId], '',
    td = [BlockedObjectName], '',
    td = [LockType], '',
    td = [RequestingText], '',
    td = [BlockingText], '',
    td = [LoginName], '',
    td = [HostName], '' -- Here we put the column names
    from @Temp_DetailReq2
    for xml path('tr'), type)) +'</font></table>'
    END
    END
    IF @SendEmail = 'YES'
    BEGIN
    EXEC msdb.dbo.sp_send_dbmail
    @profile_name = 'MyDBMailProfileName',
    @recipients = '[email protected]',
    @body = 'Please refer the attachment' ,
    @body_format = 'HTML',
    @subject = 'Alert! Blocking On ERPSVR02-02 Live Server',
    @file_attachments = @tableHTML,
    @importance = 'High';
    END
    END

    Hi Guys,
    I need help on how to generated HTML as attachment to email. I have write below stored procedure but the html did not send as attachment. Kindly guide me on how to save the generated HTML as a file and send it as attachment.
    USE [CarsemERP]
    GO
    /****** Object: StoredProcedure [dbo].[DBA_CarsemERP_SQLBlocks] Script Date: 04/01/2015 15:14:15 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- =============================================
    -- Author: <THARMENDRAN>
    -- Create date: <2014FEB21>
    -- Description: TO CHECK ANY LOCKS MORE THN 20 SEC IN SQL SERVER
    -- =============================================
    ALTER PROCEDURE [dbo].[DBA_CarsemERP_SQLBlocks]
    AS
    BEGIN
    DECLARE @iCnt As Int
    DECLARE @ICnt2 As Int
    DECLARE @SendEmail AS VARCHAR(3)
    DECLARE @Temp_DetailReq1 TABLE (
    idx smallint Primary Key IDENTITY(1,1),
    DBName varchar(30), RequestId Int, BlockingId Int, BlockedObjectName varchar(30),LockType varchar(30), RequestingText varchar(max), BlockingText varchar(max),
    LoginName varchar (30), HostName varchar (30))
    DECLARE @Temp_DetailReq2 TABLE (
    idx smallint Primary Key IDENTITY(1,1),
    DBName varchar(30), RequestId Int, BlockingId Int, BlockedObjectName varchar(30),LockType varchar(30), RequestingText varchar(max), BlockingText varchar(max),
    LoginName varchar (30), HostName varchar (30))
    SET @SendEmail = 'NO'
    SELECT @iCnt= COUNT(*) FROM DBA_SQLBlocksViewTharmen
    IF @iCnt > 0
    BEGIN
    Insert Into @Temp_DetailReq1
    Select DBName, request_session_id, blocking_session_id, BlockedObjectName,resource_type, RequestingText, BlockingTest, LoginName, HostName From DBA_SQLBlocksViewTharmen
    END
    WAITFOR DELAY '00:00:20'
    select @iCnt2= COUNT(*) FROM DBA_SQLBlocksViewTharmen
    IF @iCnt2 > 0
    BEGIN
    DECLARE @columnHeaders NVARCHAR(MAX)
    DECLARE @tableHTML NVARCHAR(MAX)
    DECLARE @body NVARCHAR(MAX)
    Insert Into @Temp_DetailReq2
    Select DBName, request_session_id, blocking_session_id, BlockedObjectName,resource_type, RequestingText, BlockingTest, LoginName, HostName From DBA_SQLBlocksViewTharmen
    SET @SendEmail = 'YES'
    BEGIN
    SET @columnHeaders = 'DBName</th><th>RequestId</th><th>BlockingId</th><th>BlockedObjectName</th><th>LockType</th><th>RequestingText</th><th>BlockingText</th><th>LoginName</th><th>HostName'
    set @tableHTML =
    '<div><b>There is blocking in VERPSVR02-02.</b></div><br>' + -- This is the bold text at the top of your email
    '<table border="0" cellpadding="5"><font face="Calibri" size=2>' +
    '<tr><th>' + @columnHeaders + '</th></tr>' +
    convert(nvarchar(max),
    select td = [DBName], '', -- Here we put the column names
    td = [RequestId], '',
    td = [BlockingId], '',
    td = [BlockedObjectName], '',
    td = [LockType], '',
    td = [RequestingText], '',
    td = [BlockingText], '',
    td = [LoginName], '',
    td = [HostName], '' -- Here we put the column names
    from @Temp_DetailReq2
    for xml path('tr'), type)) +'</font></table>'
    END
    END
    IF @SendEmail = 'YES'
    BEGIN
    EXEC msdb.dbo.sp_send_dbmail
    @profile_name = 'MyDBMailProfileName',
    @recipients = '[email protected]',
    @body = 'Please refer the attachment' ,
    @body_format = 'HTML',
    @subject = 'Alert! Blocking On ERPSVR02-02 Live Server',
    @file_attachments = @tableHTML,
    @importance = 'High';
    END
    END

  • Problem sending a HTML page

    How can i send a HTML by email??
    When i am sending a HTML he shows the code in the mail instead of showing the HTML page??
    Anyone knows how can i solve tyhis??

    are you setting the content type to text/html? there are plenty of examples out there (and in here). run a search.

  • I'm trying to send a pages document as an email attachment to pc users.  They can't access the document.

    I'm trying to send a pages document as an email attachment to pc users.  They can't access the document.  When I try go to the "file" menu, there is no "save as" option.

    Hi Shelly,
    Command-P (Print)
    In the Print dialogue, click the PDF button at lower left, choose Mail PDF
    The result should be a new email document with the pdf file attached.
    Address and send.
    The procedure applies to any document which may be printed, not just Pages documents.
    Regards,
    Barry

  • Send email in HTML format with attachment.

    I want to send out email in HTML fromat and attach a file to it. I know how to send HTML email but I cant attach a file to it.
    Can anybody help me with that?

    What kind of attachment?
    1) A file not related to the HTML
    or 2) a file used by the HTML (i.e. a GIF)?
    If 1) see here http://developer.java.sun.com/developer/onlineTraining/JavaMail/contents.html#SendingAttachments
    If 2) see here http://forum.java.sun.com/thread.jsp?forum=43&thread=242791
    (make sure you read all the thread as inline attachments are mentioned at the end)
    SH

  • How to send browser display HTML page as HTML Email using JSF

    Hi all
    i need to send a whole jsf rendered page as a html page.... . say theres a page which hav few links , images etc & theres a send email button at the end of the page. once the user clicks on the button the whole page shld appear in another window which hav from,to, subject line + the html body of tht earlier page & once he clicks the send button it should send to the sender & the receiver should see the email a s a html email.where u can click on the links,images showin etc...
    Thanks
    Saman

    Subhash,
    Here is one approach..
    1. Make the report page as PUBLIC ( no Authentication required)
    2. Create procedure which will pull the page content and send it to pre-defined e-mail address
    2.1 Use utl_http.request to pull the page content
    2.2 Store the page content in some PL/SQL variable and pass it as 'p_body_html' parameter to APEX_MAIL.SEND procedure.
    3. Schedule the above procedure to run on daily using DBMS_JOB API.
    I have not implemented it and its just a thought.
    Regards,
    Hari

Maybe you are looking for

  • Publishing w/FTP and spaces in file names

    I read that if I wanted to build a site in iWeb, and then publish to a 'non .mac' server (via FTP) that I'd have to make sure that all of my file and page names didn't have any spaces or special characters in them. I went thru all of my files and fix

  • Mac Mini's Airport Extreme card extremely inconsistent, for some reason

    Hi there. I am the owner of a late 2006 Mac Mini, which is currently running OS X 10.4.11. Up until about 2 days ago, the wireless internet connection was perfect. Then, I started noticing that pages would not load, sometimes (mostly) very slowly,and

  • IMac runs slow, restart solves for a few hours ...

    Hi, for some week's my iMac has began to run slower. The browsers ( Firefox & Safari ) become unresponsive as do Finder, other App's and the computer generally until i have to force quit and restart. Then everything is fine for several hours until gr

  • Error creating materilalized view with union all

    Could please anybody advice? What I do wrong? create table test i number not null, constraint pk_test primary key( i )); create materialized view log on test with rowid; create materialized view mvtest refresh fast on demand as SELECT i, 1 umarker FR

  • Monitoring Xi - SXMB_MONI

    Is there a way I can monitor errors reported in SXMB_MONI through RZ20?