Text format + attached image files or Html format + displayed images ?

Hi, I have this kind of probleme and I need some help.
(Code : see below)
I want to send a mail with some attached image files.
For the message part, I create a MimeBodyPart and add two kinds of message (text or html) and this part is multipart/alternative.
For the attachment part, I create another MimeBodyPart and I set the Header like this : xxx.setHeader("Content-ID", "<image>").
When I use outlook (html format) , I receive a mail with the picture displayed at the bottom, it's perfect.
However the problem is for the mailbox which is in text mode, I receive a mail with message + attachment files, but I also have some image frames generated by xxx.setHeader("Content-ID", "<image>") I guess.
Who can give me a hand to implement something that able to make difference according to text format or html format.
I post my code here, thanks a lot :
//set Message
     msg.setText(pMsgText, DEFAULT_CHARSET);
     // Partie Texte brut
     MimeBodyPart textPart = new MimeBodyPart();
     String header = "";
     textPart.setText(header + pMsgText, DEFAULT_CHARSET);
     textPart.setHeader(
               "Content-Type",
     "text/plain;charset=\"iso-8859-1\"");
     textPart.setHeader("Content-Transfert-Encoding", "8bit");
     // Partie HTML
     MimeBodyPart htmlPart = new MimeBodyPart();
     String images = BTSBackUtil.generateImgSrc(pictureContainers.length);
     String endPart = "</div>\n</body>\n</html>";
     htmlPart.setText(pMsgTextHTML+images+endPart);
     htmlPart.setHeader("Content-Type", "text/html");
     // create the mail root multipart
     // Multipartie
     Multipart multipart = new MimeMultipart("mixed");
     // create the content miltipart (for text and HTML)
     MimeMultipart mpContent = new MimeMultipart("alternative");
     // create a body part to house the multipart/alternative Part
     MimeBodyPart contentPartRoot = new MimeBodyPart();
     contentPartRoot.setContent(mpContent);
     // add the root body part to the root multipart
     multipart.addBodyPart(contentPartRoot);
     // add text
     mpContent.addBodyPart(textPart);
     // add html
     mpContent.addBodyPart(htmlPart);
     // this part treates attachment
     if (pictureContainers != null){
          PictureContainer pictureContainer = new PictureContainer();
          String fileName = "";
          for(int i = 0; i < pictureContainers.length; i++) {
               pictureContainer = pictureContainers;
               byte[] bs = pictureContainer.getImgData();
               fileName = "image" + i +".jpg";
               DataSource dataSource = new ByteArrayDataSource(fileName, "image/jpeg", bs);
               DataHandler dataHandler = new DataHandler(dataSource);
               MimeBodyPart mbp = new MimeBodyPart();
               mbp.setDataHandler(dataHandler);
               mbp.setHeader("Content-ID", "<image"+i+">");
               mbp.setFileName(fileName);
               multipart.addBodyPart(mbp);
// end attachment
msg.setContent(multipart);

Hi All!!! I have created this code , i hope this w'll solve u'r problem , this code display u'r html text and display the images below on it, no need to attach the image...... byee.
package Temp;
import javax.activation.DataHandler;
import javax.activation.DataSource;
import javax.activation.FileDataSource;
import javax.activation.URLDataSource;
import javax.mail.Authenticator;
import javax.mail.BodyPart;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
public class HtmlImageExample {
public static void main (String args[]) throws Exception {
String host = "smtp.techpepstechnology.com";;
String from = "[email protected]";
String to = "[email protected]";
//String to = "[email protected]";
String dir=null;
//String file = "C://NRJ/EmailApp/src/java/MailDao//clouds.jpg"];
//File file = new File("C:\\NRJ\\EmailApp\\src\\java\\Temp
Sunset.jpg");
// Get system properties
//Properties props = System.getProperties();
HtmlImageExample html1 = new HtmlImageExample();
html1.postImage(to,from);
// Setup mail server
String SMTP_HOST_NAME = "smtp.techpepstechnology.com";//smtp.genuinepagesonline.com"; //techpepstechnology.com";
String SMTP_AUTH_USER = "[email protected]"; //[email protected]"; //techpeps";
String SMTP_AUTH_PWD = "demo"; //techpeps2007";
//my code
public void postImage(String to, String from) throws MessagingException, FileNotFoundException, IOException
Properties props = System.getProperties();
props.put("mail.transport.protocol", "smtp");
props.put("mail.smtp.host", SMTP_HOST_NAME);
props.put("mail.smtp.auth", "true");
// props.load(new FileInputStream(file));
Authenticator auth = new SMTPAuthenticator();
Session session = Session.getInstance(props, auth);
// Create the message
Message message = new MimeMessage(session);
// Fill its headers
message.setSubject("Embedded Image");
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
message.setContent
h1. This is a test
+ "<img src=\"http://www.rgagnon.com/images/jht.gif\">",
"image/jpeg");
// Create your new message part
//BodyPart messageBodyPart = new MimeBodyPart();
//mycode
MimeMultipart multipart = new MimeMultipart("related");
MimeBodyPart mbp1 = new MimeBodyPart();
// Set the HTML content, be sure it references the attachment
String htmlText = "<html>"+
"<head><title></title></head>"+
"<body>"+
" see the following jpg : it is a car!
"+
h1. hello
"+
//"<IMG SRC=\"CID:Sunset\" width=100% height=80%>
"+
"<img src=\"http://www.yahoo.com//70x50iltA.gif\">"+
" end of jpg"+
"</body>"+
"</html>";
mbp1.setContent("h1. Hi! From HtmlJavaMail
<img src=\"cid:Sunset\">","text/html");
MimeBodyPart mbp2 = new MimeBodyPart();
mbp2.setText("This is a Second Part ","html");
// Fetch the image and associate to part
//DataSource fds=new URLDataSource(new URL("C://NRJ//MyWeb//logo.gif"));
FileDataSource fds = new FileDataSource("C://NRJ//MyWeb//Sunset.jpg");
mbp2.setFileName(fds.getName());
mbp2.setText("A Wonderful Sunset");
mbp2.setDataHandler(new DataHandler(fds));
mbp2.setHeader("Content-ID","<Sunset>");
// Add part to multi-part
multipart.addBodyPart(mbp1);
multipart.addBodyPart(mbp2);
message.setContent(multipart);
// Send message
Transport.send(message);
//mycode
private class SMTPAuthenticator extends javax.mail.Authenticator
public PasswordAuthentication getPasswordAuthentication() {
String username = SMTP_AUTH_USER;
String password = SMTP_AUTH_PWD;
return new PasswordAuthentication(username, password);

Similar Messages

  • Problems Uploading a Pages file in html format including pictures to web pa

    I have problems uploading a Pages file in html format to a web page.
    The files itself is downloaded but the images are not. How can I upload a page file in html including the pictures or illustrations?

    I just bought a macbook as well as the iwork software. I am having a few problems. I am a student and when I try to print out documents (originally word documents) it puts them automatically into textedit instead of pages. Also, the pages get all screwed up, things are missing, etc. How do I make pages my default and do i need to export? import? or do something so that these documents show up perfectly in pages?
    A second questions- When i try to print out slideshows in keynote (originally from powerpoint) the handouts print on the little edge of the paper horizontally rather than the long way. I am hoping these are easy adjustments.
    I would appreciate any help anyone can give me.
    Thank you!

  • Idoc-xi-file scenario.  how to display file in html format

    I am not sure whether this is a valid question.........but want to confirm as it was asked by somebody
    In idoc-xi-file scenario.......  how to display file in html format ??
    Thanks in advance
    Kumar

    Hi Vijayakumar,
    Thanks for your reply !! You mean to say I got to use XSLT mapping and also .htm and .html extension together to produce the html file ?? or it is sufficient to use any one of them to produce the html file ??
    Regards
    Kumar

  • File Explorer won't display image in local HTML file

    I'm studying HTML. I created a file, RECIPE.HTM and in it I have a tag to an image file, HOTDOG.PNG, located in the same folder.  When I open the RECIPE.HTM file, it displays correctly in the browser.  It will not display in the Preview Pane, however.
    It gives me the warning, "Some pictures have been blocked to help prevent the sender from identifying your computer. Open this item to view the pictures."
    Can I enable the preview pane so it will display embedded images in html documents?  I realize that on a live site this might be risky, but my files are all local.  Regardless, I'd like to have the option.

    Hi,
    If you want to get rid of the warning, you must save the complete web page, not just the html. You have 2 options in the Save as... dialog in IE that does this:
    Web page, complete (*.htm;*html)
    This stores the html, and also all related resources (images, css files, js files etc) in a separate folder on your computer.
    Web Archive, single file (*.mht)
    This stores everything inside a single file, that can be read by IE. This stores all resources within the file as binary data.
    You can refer to the link below for more details:
    http://superuser.com/questions/297428/images-blocked-in-windows-explorer-preview-pane-when-viewing-saved-webpages
    Note: Since the website is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
    Roger Lu
    TechNet Community Support

  • Image / file upload error         cannot upload image even after setting write permissions

    Hi there everyone
    I am having this problem when I try to upload a file (image file) to my server
    I have a dynamic for working fine , all the other fields insert the information ok then I try to add an image upload behaviour to a file field
    When I try to upload the file I get this error
    Error:
    An error occurred while inserting the records.
    File upload error: File upload error. Error creating folder..
    File upload error. Internal error.
    Developer Details:
    tNG_multipleInsert error.
    An error occurred while inserting the records. (MINS_ERROR)
    File upload error: PHP_UPLOAD_FOLDER_ERROR
    File Upload Error. No write permissions in "../../productimages/" folder.
    (FILE_UPLOAD_ERROR)
    So I login to my server and change the write permissions to 777 and then try again and get the same message
    I have closed DW and tried again and still get the same message......
    I think I have followed all the steps correctly..... I have done the same type of forms many time and tested them locally on WAMP testing server and all work ok......
    So..... Anyone got any ideas
    Any help would be great
    Have a nice day

    On 5/17/07 4:26 PM, in article [email protected],
    "Gü[email protected]" <> wrote:
    >
    > To my experience servers behave differently -- on some I really had to use
    > 777, others are happy with 755.
    >
    > in regards to "any user" :: On most ADDT respectively MX Kollection - based
    > backends I made the image & file upload feature available to user having e.g.
    > the "levels" 1 & 2, but not 3 -- I wouldn´t expose something like this to all
    > users
    >
    > Günter Schenk
    > Adobe Community Expert, Dreamweaver
    My backend is only for admin, so they are the only ones who can access the
    upload pages. My concern is an images folder on the site being 777. Can't
    anyone from the outside plant a file in that folder if they just know where
    to find it using an ftp program? ?

  • Drag image file from portfolio pdf into image field in reader

    I'm new to the Adobe world and this is my first project. I'm not sure if this is even possible, but here's what I'm trying to do...
    One document is a PDF portfolio with 200 images (jpg or tif). Each image in the portfolio will have a description. The second document is a PDF form created in LiveCycle. I want to be able to (from Reader with rights enabled) import the image from the portfolio into a field and have that image displayed along with the description all inside the form. Thanks so much in advance!
    Gabe

    Hi, I'm using CS4 and would love to be able to drag n drop straight to a new layer in an existing file.
    At present when I drag n drop I get a new image in PS. I then have to move this to my existing image. I have tried draging to the tab, the layer box, the image, the blank space, using shift,ctrl & alt.
    A simple how to would be nice

  • How do I call image file names from MySQL & display the image?

    Hello everyone,
    I have image file names (not the full URL) stored in a MySQL database. The MySQL database is part of MAMP 1.7 and I am using Dreamweaver CS3 on a Mac Book Pro.
    I would like to create a catalog page using thumbnails, and PayPal buttons displayed within a table, in rows. With the image centered and the PayPal button directly underneath the image.
    How do I use PHP to call the thumbnail images as an image not the file name, to be displayed in the table?
    Thanks in advance.

    slam38 wrote:
    How do I use PHP to call the thumbnail images as an image not the file name, to be displayed in the table?
    Open the Insert Image dialog box in the normal way, and navigate to the folder that contains the images. Then copy to your clipboard the value in the URL field, and click the Data Sources button. The following screenshot was taken in the Windows version, but the only difference is that Data Sources is a radio button at the top of the dialog box in Windows. It's a button at the bottom in the Mac:
    After selecting Data Sources, select the image field from the approriate recordset. Then put your cursor in the URL field and paste in the path that you copied to your clipboard earlier.

  • Adding image file name and logo to image

    Can you do batch processing of images to automatically insert the image file name, say at the bottom along with a logo, in black font. The logo stays constant but the image deatils will change with each image?
    Can this be done in Lightroom or then the full Photoshop?
    Thanks!

    I've taken the script mentioned above and modified it to the best of my abilities.  Still getting the same error, unfortunately:
    function main(){
    var suffix ="cropped";
    var docPath =Folder("~/Desktop");
    if(!docPath.exists){
       alert(docPath + " does not exist!\n Please create it!");
       return;
    var fileName =activeDocument.name.match(/(.*)\.[^\.]+$/)[1];
    var fileExt =activeDocument.name.toLowerCase().match(/[^\.]+$/).toString();
    var saveFile = new File(docPath +"/"+fileName+suffix+'.'+fileExt);
    switch (fileExt){
       case 'jpeg' : SaveJPEG(saveFile); break;
       default : alert("Unknown filetype please use manual save!"); break;
    if(documents.length) main();
    function SaveJPEG(saveFile, jpegQuality){
    jpgSaveOptions = new JPEGSaveOptions();
    jpgSaveOptions.embedColorProfile = true;
    jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
    jpgSaveOptions.matte = MatteType.NONE;
    jpgSaveOptions.quality = jpegQuality; //1-12
    activeDocument.saveAs(saveFile, jpgSaveOptions, true,Extension.LOWERCASE);

  • I moved my podcasts and image files to a subfolder - now images won't display in iTunes

    I moved my podcasts and image files into a subfolder. The podcasts are working OK, but the image file does not display in iTunes anymore.
    The feed is directed through feed burner at http://feeds.feedburner.com/VineyardChurchOfMilan.
    The source xml is at https://www.dropbox.com/sh/rl89sk4lkrn9930/Zm0Jb6C1Hj/Podcast (MilanVineyardChurch.xml)
    The iTunes link is at https://itunes.apple.com/us/podcast/vineyard-church-of-milan/id562567379
    I added "/Podcast/" to the image path url in the <itunes:image> tag in the xml file and updated the path to the xml file in feedburner, but I did not add the <itunes:new-feed-url> again. Do I need to do this to force the iTunes scripts to reread the whole file again? I thought that if the iTunes scripts are reading the feedburner file that they would pick up path changes to the image when they read the feedburner file. The location of the feedburner file has not changed. Only the location of the source xml and the image have changed. Feedburner is working right, and shows the image.

    You have changed the image URL in the 'image' tag but you have not changed it in the 'itunes:image' tag, and that is what is applicable here.
    iTunes is looking for an image at
    http://dl.dropbox.com/u/89406141/MilanVineyardChurch.png
    and not finding one there. When you have amended the tag with the new URL it will probably take some days before the image appears in the Store.
    The new image is apparently at http://dl.dropbox.com/u/89406141/Podcast/MilanVineyardChurch_144.png - this is 144x144 which is inadvisably small for iTunes.
    Although your episodes, which have Feedproxy URLs, are appearing OK, iTunes does not get on at all well with Dropbox and you might be advised to consider hosting your image on an ordinary web server. However, it's possible that it will work once you've amended things.

  • IPhotoBook Image File Sizes and Formats

    Morning (it is here in the UK!)
    Similar questions found on the forum - but not exactly what I need.
    Please may I ask for your help on the forum.  I notice 'Old Toad' in particular seems to respond to these types of enquiries!
    I've got an iMac - about four years old - with Mac OS X 10.6 and iPhoto 8.1
    I'm building an iPhotoBook (the Extra Large 13" x 10" Size) of Press Clippings which I'm scanning onto a PC, putting into Photoshop and then transferring to the iMac to create the Photobook.  Doing it this way as my Photoshop license is for my PC, plus my PC is newer. 
    Each of the two or three photobooks will run to possibly 100 pages - unsure what my maximum page count allowed will be.
    I'm scanning at 600 DPI using an A3 Scanner.
    Saving as a TIFF once I've created the layout of each page in Photoshop.
    So I'll end up with a series of pre-built pages for the 13" x 10" book ready to drop into iPhoto Book.
    Looking at my file sizes they're currently anywhere between 38 and 45 MB each.
    Am I going to run into problems uploading these?  Will Photobook be happy with my TIFF files?
    Such a vast project want to get it right before I end up going back over my initial work.
    Thank you in advance.

    Scan to tiff by all means and at a sRGB color profile, but output jpegs. There's nothing to be gained using the tiffs in a book. It's converted to pdf when uploading anyway. Most importing thing, preview the pdf before uploading. That's what your book will look like when finished.

  • JDBC + SERVLET: inserting text data  to access file from Html form

    Hi everybody !
    I'm trying to insert text data from my html form to access database using servlet and jdbc technologies.
    The problem that I'm that the data is TEXT, but not the English language !!!
    So my access db file gets - ???????? symbols instead the real text.
    This is the form line that sending data to my servlet:
    <form
    method="POST"
    ACTION=http://localhost:8080/servlet/myServlet enctype="text/html">
    And this is servlet line that defines response content:
    res.setContentType( "text/html" );
    What can I do to get in access db file the right text format and not a ???????? symbols.
    Maybe I must to ad some <meta ...> , but where ?

    You're dealing with Unicode, I'd guess, and not ASCII.
    I guess I'd have two questions:
    (1) Is the character encoding on your pages set properly for the language you're trying to use?
    (2) Does Access handle Unicode characters?
    Access isn't exacly a world-class database. (If it was, there'd be no reason for M$ to develop SQL Server.) I'd find out if it supports other character sets. If not, you'll have to switch to a more capable database that does. - MOD

  • How To formate PDF Data(Binary) to HTML Formate

    Hi All,
    I am using PDFs in my application. Once the user has submitted his project in formation through pdf, it stores in BAPI. When i tried to retrive the data from back end to display in a view. it shows me all the information is in single line because of PDf binary data. Can any one knows about how to display pdf data in a view (html) with multiple lines.
    Thanks
    Regards
    Ravi.Golla

    Hi Ravi,
    See this thread...It might be useful for u..
    /people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4fd2d690-0201-0010-de83-b4fa0c93e1a9
    Urs GS

  • How to display Dynamic text after adding flash file to html

    Please help - I have a dynamic text field in a movieclip
    inside a main movieclip - Within flash the dynamic text display
    properly but once I load the file to an html page the dynamic text
    no longer display - It loads undefined in text box. However when I
    remove the movieclip from main movieclip text display no
    problem.

    that's as2 code, not as3. please post in the correct forum
    next time.
    either about.txt is not in the same directory as the html
    file that loads or embeds your swf or there's a case issue with
    about.txt really being About.txt, for example.

  • User upload of non JPG image files to be then displayed in iScripts

    I am attempting to build a tool for non-technical users to easily create quick link pagelets with icons that point to URLs or Content References. One of the issues I am running into is the image upload PeopleCode commands seem to limit the file type to jpegs. Jpeg do not allow transparent backgrounds which makes it hard to take seals and similar icons and just super impose them over a background. When I looked at the file attachment functions I did not see a way to output a web server URL for image to be included on a page it only looked like there were only ftp server calls. Any thoughts?
    -Bryan

    Use the File Attachment API (AddAttachment) to upload files to a database table, and then use an iScript to serve them. This blog post has an example iScript for reading attachments from tables: http://jjmpsj.blogspot.com/2009/01/exporting-attachments-part-2.html.
    Chapter 2 of my PeopleTools Tips and Techniques book (http://www.amazon.com/PeopleSoft-PeopleTools-Techniques-Oracle-Press/dp/0071664939) has a complete example including a component for uploading files and an iScript for serving them. I call the component "Web Assets."

  • Image file to byte[] to resized image

    I have a byte[] that I have recieved from my server, this byte[] is read from an image. I now need to resize it and save it to the users computer as an image again. I have tried to do this, but lost information on the way. For example i tried making it into a BufferedImage, resize that image, and then write it to the computer. This however, caused (for me) very important image information to be lost, such as the jpg image tags. I could save this byte[] directly to the computer as an image and keep the image tags, but then I would have it in the same size. Is there any way for me to resize it before saving it, without losing information?
    If it's impossible, please tell me so I know and can start thinking about how to do an alternative solution, however, I think this should be possible.
    Edited by: Alle55555 on Jul 16, 2009 2:57 AM

    This is my final code for solving the problem:
    try
                                  //Read the byte[] into an IIOImage
                                  ImageReader ir = ImageIO.getImageReadersByFormatName("jpeg").next();
                                  ByteArrayInputStream bais = new ByteArrayInputStream(imageBytes.get(viewingIndex));
                                  ImageInputStream iis = ImageIO.createImageInputStream(bais);
                                  ir.setInput(iis);
                                  IIOImage image = new IIOImage(ir.read(0), null, ir.getImageMetadata(0));
                                  //Resize the image
                                  Image scalingImage = Toolkit.getDefaultToolkit().createImage(imageBytes.get(viewingIndex));
                                  double scale = image.getRenderedImage().getWidth()/400;
                                  scalingImage = scalingImage.getScaledInstance(400, (int)((double)(image.getRenderedImage().getHeight())/(double)(scale)), Image.SCALE_SMOOTH);
                                  MediaTracker medTra = new MediaTracker(this);
                                  medTra.addImage(scalingImage, 0);
                                  medTra.waitForID(0);
                                  BufferedImage bufferedImage = new BufferedImage(scalingImage.getWidth(this), scalingImage.getHeight(this), BufferedImage.TYPE_INT_RGB);
                                  Graphics2D g = bufferedImage.createGraphics();
                                  g.drawImage(scalingImage, 0, 0, this);
                                  image.setRenderedImage(bufferedImage);
                                  //Write the IIOImage to a chosen file
                                  ImageWriter iw = ImageIO.getImageWritersByFormatName("jpeg").next();
                                  ImageOutputStream imageOutputStream;
                                  File selectedFile = fileChooser.getSelectedFile();
                                  if(selectedFile.getAbsolutePath().endsWith(".jpg") || selectedFile.getAbsolutePath().endsWith(".JPG") || selectedFile.getAbsolutePath().endsWith(".jpeg") || selectedFile.getAbsolutePath().endsWith(".JPEG"))
                                       imageOutputStream = ImageIO.createImageOutputStream(fileChooser.getSelectedFile());
                                  else
                                       imageOutputStream = ImageIO.createImageOutputStream(new File(fileChooser.getSelectedFile().getAbsolutePath() + ".jpg"));
                                  iw.setOutput(imageOutputStream);
                                  iw.write(image.getMetadata(), image, null);
                                  imageOutputStream.close();
                             catch (Exception e){e.printStackTrace() ;}

Maybe you are looking for

  • How to use a file transport proxy service as trigger for a webservice

    Hi, I've implemented a alsb file transport proxy service. This proxy is watching a common directory and detects new files. After detection, the proxy move them in an archive folder. After that I want call an external webservice with the filename as i

  • Many Chapters - How Best to Setup Project in Encore?

    Im starting work on a DVD of footage ripped from a clients family VHS tapes. Ill be doing the editing in PP2 and then authoring in EncoreDVD 2. I do not have the structure of the DVD planned out yet, but will probably have a few dozen Chapters, of th

  • Http server to configure mod plsql for creating DAD required by Workflow

    Hi, I have a question. Actually, I am working on Oracle Workflow 2.6.3, which need the Oracle HTTP server to configure the DAD. I have already installed Oracle HTTP server (which called Apache Standalone 10.1.2.0.0) using the Oracle Database10g Compa

  • Country-Specific PO SmartForms

    We have a standard PO SmartFrom for US, MX and CAN. Due to legalities in CAN, they want their "Terms and Conditions" as part of the PO print-out (SmartForm). If we create a CAN specific Form, how does the system know to use this for for PO's with CAN

  • Call transaction & leave the current screen

    Hi I have created two Table maintanence Generator one for master table & second for transaction table. In my master table i have written code for calling the second TMG ie, call transaction 'zhdms'. but my problem is from my first TMG when im clickin