Need to send an attachment with an Email Outlook

Hi all
I have a requirement in which I need to send an attachment in a mail as an attachment Outlook. I used the following code and was wondering what I need to change so that the Outlook attachment works very well-
public static void sendMessageWithAttachments (EmailPoller emailPoller, body String, String toAddresses, String ccAddresses, String subject, don't BlobDomain)
throws MessagingException, Exception {}
Properties props = new Properties ();
A session = Session.getDefaultInstance (propellers, null);
MimeMessage message = new MimeMessage (session);
Fill in the header of the e-mail
message.setSubject (subject);
message.setContent (message, "text/plain");
If ((toAddresses! = null) & & (toAddresses.trim () .length () > 0)) {}
message.addRecipient (Message.RecipientType.TO,
new InternetAddress (toAddresses));
}
If ((ccAddresses! = null) & & (ccAddresses.trim () .length () > 0)) {}
message.addRecipient (Message.RecipientType.CC,
new InternetAddress (ccAddresses));
}
Create a component multi to combine the Mime body parts
Several multipart part = new MimeMultipart();
Create your new message part to set the text within the email and add it to the multipart
BodyPart messageBodyPart = new MimeBodyPart();
messageBodyPart.setText (body);
multipart.addBodyPart (messageBodyPart);
Create and add to the multi part & fill MimeBodyPart the attached content
messageBodyPart = new MimeBodyPart();
Data source source = new ByteArrayDataSource (associatedEmail.toByteArray (), "text/plain");
messageBodyPart.setDataHandler (new DataHandler (source));
messageBodyPart.setFileName ("associatedEmail.txt");
multipart.addBodyPart (messageBodyPart);
Associate the multi-part content of the message
message.setContent(multipart,"text/html");
emailPoller.forwardMessage (message); send email with attachments
}
That I tried was to define the MIME type for the data source @
source DataSource = new ByteArrayDataSource (associatedEmail.toByteArray (), "text/plain");
of application / vnd.ms - Outlook but it creates an Outlook message as an atatchment but refuses to open it and displays an error.

Anyone who knows how to operate it please?

I guess that by "Outlook message" you mean you want to join another full message this message.
Try this: http://www.oracle.com/technetwork/java/javamail/faq/index.html#forward

Tags: Java

Similar Questions

  • Smartphones blackBerry apps I want to download say that I need to send a link to my email and go from there

    I get online with my phone a bold 9000 and the apps that I download say I need to send a link to my email and go from there. I send the link and I opened the email and click on it and it continues the same cycle. Apparently not pages recognize the fact that I connect from my mobile. What can I do?

    [as published]

    I realized that the problem was because I was using firefox and not the blackberry, a... I think that solved my problem. Thank you

  • When I try to send an attachment with a PDFor JPEG, the indicator "sending" appears and never indicates that the document was "sent". He did not finish the task.

    When I try to send an attachment with a PDF or JPEG, the indicator "sent" is displayed and never indicates that the document was "sent". He did not finish the task.

    You have security software that may block the download?

  • I am trying to send an attachment to an email address. My SMTP is not found.

    When I try to send the attachment of the message indicates that it does not find the SMTP "of home.  He also says that I should check that I entered the server name correctly.  How do I get my message in the document sent by e-mail?

    Thank you!

    What email program are you using? If you right-click | Send to | Recipient of the message, Vista wants use you an e-mail client like the built in Windows Mail. If you use another program, in particular of Webmail, you must start the message and then browse and attach the file.

  • Send an attachment with excel

    Whenever I try to attach an email through excel save and send I get an error message that there is not an email associated with the program.  He is told to go to default programs and implemented.  How can I do this?

    Hello khemphill,

    You must install an e-mail client program, such as e-mail in Office 365 or Outlook Express, then set it as your default e-mail program in Windows 8.

    Otherwise, you will need to first create the email, and then attach the Excel file.

  • Why can't some other attachments open, I send Microsoft Works with any email account that I use (yahoo, gmail... It does not matter)?

    For the past two years, other people could not open attachments, I have send from Microsoft Works.  It doesn't matter if I use my gmail or yahoo account.  When I save the documents it saves it to the wps format.  Ive tried to change and he did some weird things when I do.  It's like it saves it in any format, I chose (I never know if it's the right one... I literally just choose one and hope it works), but he still keeps the wps document.  So I have to double documents saved in two formats instead of one replacing the other.

    He did not always do that.  There was a time when I was able to send attachments without problem.

    Help, please!  Its make my new work work home.

    1. open your MS Works... File... Save as... to save as type, select .doc format..., click Save.

    2. Yes, you have now 2 identical files, one is the wps format and the other in the .doc format. Remove the wps, if you wish.

    3. the doc file by email as an attachment to your recipient.

  • I can't send an attachment from my email whice is an overview, but when I click on the attachment it does not bring the browser window

    When I click on the attachments it does not have a window to be able to navigate to my files

    Hello

    You also have another question in these Forums on your e-mail problems.

    They can be connected:

    Here is a link to your other question:

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_vista-windows_install/when-i-try-to-send-an-email-i-get-this-msg-the/a8333fe9-cda8-49bc-A4E7-f8756a3086fc

    See you soon.

  • How to send a fax with a scanned document

    I need to send a fax with 4 pages of document I scanned, but when I go on my page of the Fax Console it gives me the option to include my documents? !!!

    Open the document in any application that will allow you to see.  Click file > print.  In the print dialog box, click the drop-down arrow and select the "Fax" printer  Click on print, then follow the prompts in the Send Fax Wizard.

  • How to read an attachment with Adobe Acrobat in my e-mail address?

    How to read an attachment with Adobe Acrobat in my e-mail address?

    Hi hand hunter.

    If you have PDF attachment with your email and you use windows.

    Try make first right click on any PDF document and select the option Openwith--> choose default program... Find a Reader / Acrobat. That should help him.

    Or click on the attachment and once you are trying to open what should ask you to choose the application open with if you have not opened before PDF document.

    Kind regards

    Ajlan Huda.

  • How to send and attachment

    Hello
    I was able to send e-mail from Oracle. Now, I want to send an attachment with it. To do this, I have correctly configured webutil and use it, I have uploaded any type of file on the oracle database. Where the file resides in the BLOB field.
    And now I want to send it as an attachment with my e-mail address.

    All-in-one to give me the code of an attachment or guide me for this can. I'm really stuck on this issue. Please help me.

    My Oracle configuration:
    OS: Windows 7 ultimate (32 bit)
    Database: Oracle 10g Express Edition
    Forms: Oracle Developer Suite 10g (10.1.2) R2

    Uh, if you would have mentioned that earlier... Take a look at documentation of 10.2 for utl_smtp where not a single word is written on SSL. Then take a look at 11.2 documentation, where you utl_smtp.starttls that is required to send a STARTTLS command at the active SSL SMTP server. SSL is not supported 10.2 (you can run via some hack, google maybe askt).
    Must be SSL? I mean there are a few free mailprovider that do not use SSL. If it were to be SSL you might take a look at the virtual machine, I you provided a link (it's a 11.2.0.2 database which should support this) and try from there

    see you soon

  • I received an attachment to an email that I need to read, but when I try to open it I get an error box indicating that this file does not have a program associated with it.

    I am not computer savy and don't know how to find a program that will help me to open an RTF file. It is an attachment to an email that I really need to open. How can I solve this problem? Thank you

    Save the attachment in your documents folder. Can still be there, and double-click it. If there is no program associated with the RTF files, you will be asked to choose a default program. The choice of WordPad.

  • When I reply to an e-mail message, I need an option to have the active attachment to this email (as in redirect)...

    When I send an e-mail message, the attachment is automatically added to the new e-mail message. It is ok. However when I answer, the attachment does not come and sometimes I need to have the current attachment. So I need an option like "reply with attachment" or something like that...

    Thank you

    Re: Forwarding

    You have the possibility to transmit the received email 'inline' or as an 'attachment '.
    This can be set up here:
    'Tools' > 'Options' > "Composition" > tab "General".
    It is because you do not react to a specific e-mail - selection of information of another person to another person, who may be better sent as an attachment.

    Re: response
    In this case, you have the possibility:

    • include the email received in a response
    • Does not include the e-mail received in a response
    • include the selected part (citation) of the email received in response.

    A response implies an ongoing conversation and if the option to include the conversation is available.
    This is put in place here:
    "Tools" > "Account settings" > "Composition & addressing" for the e-mail account.

    But whether you choose to "automatically quote the original message when replying" or not, you can always highlight a section of text and then click 'Reply' to include only the selected section of the text.

    A response will also include all received attachments attached to the original email because you don't need to send the shippers own spare.

    Otherwise, you create a new message 'Write' and attach the original e-mail, so this isn't technically an answer - you do not use the 'Reply' button and these emails will not be strung. It is more difficult to see the continuity of the conversation.

  • I need to change an attachment that was sent to my yahoo email account

    I have an attachment to email yahoo containing the 1 document with a file name - Office word97 .doc and another who is a flier on a .xls, office excel 97.

    I need to change the flier and I don't know how. When I open it I can modify it, but when I go to save it, the changes does not appear.  As you can as I'm not that savy on this, so is there someone who could tell me how I can edit them? PLEASE

    For all the attachments you open the attachment, use ' Save as ' in word/excel to save the file in a directory of Documents, then open the file in this location to edit, when done save, then send your msg with that edited the attached file.

  • How to send a mail with attachment

    Hi friends,

    I am using soa 11.1.1.6
    Jdev 11.1.1.6
    WebLogic:-11.1.1.6

    I want generated e-mail with attachment in BPEL 11 g. Here's what I did in my bpel process

    Create processes bpel from simple Hello world.

    In the e-mail activity below details are given

    < name of scope = "Email1" >
    < bpelx:annotation >
    < bpelx:pattern = "bpelx:email" patternName > < / bpelx:pattern >
    < / bpelx:annotation >
    < variables >
    < variable name = "varNotificationReq".
    messageType = "ns1:EmailNotificationRequest" / >
    < variable name = "varNotificationResponse".
    messageType = "ns1:ArrayOfResponse" / >
    < variable name = "NotificationServiceFaultVariable".
    messageType = "ns1:NotificationServiceErrorMessage" / >
    < / variables >
    < name of sequence = sequence of '1' >
    < assign the name = "EmailParamsAssign" >
    < copy >
    < expression = "string ('Default')" / >
    < variable = part of the "varNotificationReq" = "EmailPayload."
    Query = "/ EmailPayload / ns1:FromAccountName" / >
    < / copy >
    < copy >
    < expression = "" string ()"/ >
    < variable = part of the "varNotificationReq" = "EmailPayload."
    Query = "/ EmailPayload / ns1:Bcc" / >
    < / copy >
    < copy >
    < from expression = "string ('[email protected]')" / >
    < variable = part of the "varNotificationReq" = "EmailPayload."
    Query = "/ EmailPayload / ns1:Cc" / >
    < / copy >
    < copy >
    < expression = "" string ()"/ >
    < variable = part of the "varNotificationReq" = "EmailPayload."
    Query = "/ EmailPayload / ns1:ReplyToAddress" / >
    < / copy >
    < copy >
    < expression = "string ('testing')" / >
    < variable = part of the "varNotificationReq" = "EmailPayload."
    Query = "/ EmailPayload / ns1:Subject" / >
    < / copy >
    < copy >
    < from expression = "string ('[email protected]')" / >
    < variable = part of the "varNotificationReq" = "EmailPayload."
    Query = "/ EmailPayload/ns1: to" / >
    < / copy >
    < copy >
    < delivery > < xmlns = "http://xmlns.oracle.com/ias/pcbpel/NotificationService" > < MimeType xmlns = "http://xmlns.oracle.com/ias/pcbpel/NotificationService" > multipart/mixed < / 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 > < 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 / > < / from >
    < variable = part of the "varNotificationReq" = "EmailPayload."
    Query = ' / EmailPayload/ns1: Content "/ >
    < / copy >
    < copy >
    < from expression = "string (" text/html; Charset = UTF-8 ")" / >
    < variable = part of the "varNotificationReq" = "EmailPayload."
    Query = "/ EmailPayload/ns1: Content / ns1:ContentBody / ns1:MultiPart / ns1:BodyPart [1] / ns1:MimeType" / >
    < / copy >
    < copy >
    < from expression = "" Hi"" / >
    < variable = part of the "varNotificationReq" = "EmailPayload."
    Query = "/ EmailPayload/ns1: Content / ns1:ContentBody / ns1:MultiPart / ns1:BodyPart [1] / ns1:ContentBody" / >
    < / copy >
    < copy >
    < expression = "string (' application/xml'); "/ >
    < variable = part of the "varNotificationReq" = "EmailPayload."
    Query = "/ EmailPayload/ns1: Content / ns1:ContentBody / ns1:MultiPart / ns1:BodyPart [2] / ns1:MimeType" / >
    < / copy >
    < copy >
    < expression = "string ('result.xml')" / >
    < variable = part of the "varNotificationReq" = "EmailPayload."
    Query = "/ EmailPayload/ns1: Content / ns1:ContentBody / ns1:MultiPart / ns1:BodyPart [2] / ns1:BodyPartName" / >
    < / copy >
    < copy >
    < expression = "bpws:getVariableData('outputVariable','payload','/client:processResponse/client:result')" / >
    < variable = part of the "varNotificationReq" = "EmailPayload."
    Query = "/ EmailPayload/ns1: Content / ns1:ContentBody / ns1:MultiPart / ns1:BodyPart [2] / ns1:ContentBody" / >
    < / copy >
    < / assign >
    < call name = "InvokeNotificationService".
    portType = "ns1:NotificationService."
    partnerLink = "NotificationService1."
    variableentree = "varNotificationReq".
    outputVariable = "varNotificationResponse."
    operation = "sendEmailNotification" / >
    < / sequence >
    < / scope >


    I'm able to generate E-mail with an attachment, but I do not see that the xml data in the attached file yet the file size is 64 b.

    I think I need to convert the data before sending it as an attachment. Could someone help me please by generating the XML.

    Kind regards
    Tarak

    Hi Tarak,

    You need not specify the MIME Type such as application/xml you don't read a .xml file.

    I'm assuming you are trying to send the result with its XML form variable in the attachment. So, follow the following steps to achieve the same (basically only first steps as my blog).

    -Open the e-mail from the Design view activity and go to the Attachments tab
    -Define the MIME Type such as text/plain; (no need to set as xml) and the name of the attachment as result.xml (what you do already)
    -The content to write this:

    ora:getContentAsString(bpws:getVariableData('outputVariable','payload'))
    

    ora: getContentAsString() function returns you the resulting data in its xml form.

    Be sure to check changes to the source code also like my Jdeveloper, they don't think is in Design view. Test and let me know if the problem persists.

    Kind regards
    Neeraj Sehgal

  • I need to send a copy of a CD I have to my email to lawyers. How can I do this?

    I need to send a copy of a cd that I have to my email to lawyers how to do this

    original title: cd

    First of all – communicate with your lawyer and ask them how they would like to receive.  Depending on the size (full) the CD is - there may be no email provider that you could send it straight through and you would need to put the content (or a CD image) on a web site site/SFTP/etc.  Also - they may prefer you send (postal service) their copy.

Maybe you are looking for