How can I get Read receipt using DSN?

Hi all,
I can able to get the Delivered/Undelivered receipt using following code, but am not able to receive Read receipt.
Am sure I need to add few lines to get that Read receipt. But am not get exact code to achieve that. Already I have searched lot here.Still not get exact code to read receipt using DSN.
Following is a code, Which am using to get Delivered/Undelivered receipt successfully:
import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;
public class testMail {
    public static void main(String args[]) throws Exception {
        String host = "172.15.4.12";
        String from = "[email protected]";
        String to = "[email protected]";
        String dsn = "SUCCESS,FAILURE,DELAY ORCPT=rfc822;" + from;
        // Get system properties
        Properties properties = System.getProperties();
        // Setup mail server
       properties.setProperty("mail.smtp.host", host);
       properties.put("mail.smtp.dsn.notify", dsn);
        // Get the default Session object.
        Session session = Session.getDefaultInstance(properties);
        // Create a default MimeMessage object.
        MimeMessage message = new MimeMessage(session);
        // Set the RFC 822 "From" header field using the
        // value of the InternetAddress.getLocalAddress method.
        message.setFrom(new InternetAddress(from));
        // Add the given addresses to the specified recipient type.
        message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
        // Set the "Subject" header field.
        message.setSubject("hi..!");
        // Sets the given String as this part's content,
        // with a MIME type of "text/plain".
        message.setText("Delivered:");
        // Send message
        Transport.send(message);
         System.out.println("Message Send.....");
}with above code,I can able to get Delivered/Undelivered receipt.
I need code to get the Read receipt by using Java mail API.
Already I did lot of search in google and got weird.
Thats why I post here.If anybody have the sample code to do this pls., share here..this helpful to lot.
Thanks in advance.

bshannon wrote:
Please read [RFC 3798|http://www.ietf.org/rfc/rfc3798.txt].
You'll need to set the Disposition-Notification-To header using the setHeader method.Hi I got the solution with below code. I add just one line code in my previous code.Now its work fine. But As bshannon replied me, here am not used setHeader method.I have used addHeader method.
below my code:
import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;
public class testMail {
    public static void main(String args[]) throws Exception {
        String host = "172.16.3.13";
        String from = "[email protected]";
        String to = "[email protected]";
        String dsn = "SUCCESS,FAILURE,DELAY ORCPT=rfc1891;" + to;
        // Get system properties
        Properties properties = System.getProperties();
        // Setup mail server
       properties.setProperty("mail.smtp.host", host);
       properties.put("mail.smtp.dsn.notify", dsn);
        // Get the default Session object.
        Session session = Session.getDefaultInstance(properties);
        // Create a default MimeMessage object.
        MimeMessage message = new MimeMessage(session);
               // value of the InternetAddress.getLocalAddress method.
        message.setFrom(new InternetAddress(from));
        // Add the given addresses to the specified recipient type.
        message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
       //below one line code I added to get read receipt mail.
        *message.addHeader("Disposition-Notification-To", "[email protected]");*   
    // Set the "Subject" header field.
        message.setSubject("hi..!");
        // Sets the given String as this part's content,
        // with a MIME type of "text/plain".
        message.setText("Hi this is test mail:");
        // Send message
        Transport.send(message);
         System.out.println("Message Send.....");
Hi bshanon thanks for your kind reply

Similar Messages

  • How can I get the receipt of my old purchases in particular application?thank you

    how can I get the receipt of one of my oldest purchased in particular application?
    thank you

    If you no longer have the original email receipt for it then all you can do is try and find it in your account's purchase history and (depending upon what you need it for) either copy it's details or take a screenshot : log into your account on your computer's iTunes via the Store > View Account menu option, you should then see a Purchase History section with a 'see all' link to the right of it, click on that and you should then see a list of your purchases.

  • Hi, I purchased apple applications and did not receive receipt, how can I get the receipt?

    Hi,
    I purchased some apple applications and already paid for this in my credit card, but I did not get receipt for it.
    The purchase was on July 5, 2012.
    How can I get the receipt for this purchase?
    Thanks!

    Call the Apple Store and inquire. I believe I read that it can take several weeks for them to send the card, but I'm not certain. The store should be able to tell you.
    Regards.

  • Have tried to restore settings due to problems, now Iphone shows Sim Failure, how can I get back to using my phone? Please help, its a business phone. :(

    Hi, I have tried to restore settings on my Iphone due to problems I was having with the phone cutting out when talking on the phone, now Iphone shows Sim Failure, how can I get back to using my phone? Please help, its a business phone.

    Hi jclarke64, 
    Thank you for contributing to the Apple Support Communities. 
    I'm sorry to hear that your iPhone 4s was lost, and glad that you were able to upgrade. 
    If your iPhone 4s was backed up to iCloud or using iTunes, you can restore the backed up data to your new phone. 
    See the steps in this article for help with restoring from a backup:
    Back up and restore your iPhone, iPad, or iPod touch using iCloud or iTunes - Apple Support
    All the best,
    Jeremy 

  • I have a recorder that outputs wma files. How can I get garageband to use my wma files?

    I have a recorder that outputs wma files. How can I get garageband to use my wma files?

    I don't think that GarageBand can use wmas, but there's always good old conversion, and GarageBand can definitely use mp3s. Personally, I recommend media.io for stuff like this, but of course it depends on the size of your files. Otherwise I don't know that there's anyway to get GarageBand to work with them...

  • Mail application is still there. All of my emails and folders are gone since iCloud. How can I get them back using Snow Leopard? Or can I? Do I have to wait for Mountain Lion?

    Mail application is still there. All of my emails and folders are gone since iCloud. How can I get them back using Snow Leopard? Or can I? Do I have to wait for Mountain Lion?

    I need to check a few other things...
    Click on 'Mail' in the upper left corner next to the Apple ()
    Click Preferences
    Click the 'Accounts' tab
    Make sure your iCloud account is highlighted in the column on the left.
    In the account information section what does it say next to:
    Incoming Mail Server?
    Outgoing Mail Server?
    Also, did you use MobileMe before the iCloud?

  • How can i get system variable using java

    Hi,
    I just want to know how can i get system variables using java code.
    for example i want to get the the date for today or i want to get the number of processes that's running.
    Thanks alot

    Hi,
    I just want to know how can i get system variables
    using java code.
    for example i want to get the the date for today or i
    want to get the number of processes that's running.
    Thanks alotSome generic "system variables" are available though Java, usually through the System class.
    Date today = new Date();
    is instantiated with the current date and time.
    Other system values, like environment values, should be passed to java through the command line (-D option) by setting system properties.
    Finally, platform specific values like the number of processes running will have to be written in platform specific code and executed by JNI (java native interface).
    Java is platform or system agnostic. Common system values, like time, are implemented. Hopefully you won't need platform specific values.

  • How can I get computer to use external DVD drive?I have a HP dvd640 plug in play drive I want to ude but my iMac dosen't see it as connected.

    How can I get *computer* to use external DVD drive? (1.8 GHz PowerPC G5 Version 10.3.9)

    Place cd/dvd in drive.  cd/dvd icon will show on desktop.
    How can I get computer to use external DVD drive?I have a HP dvd640 plug in play drive I want to ude but my iMac dosen't see it as connected.
    What is ude?
    How is it connected?  firewire or usb?
    When connected it should appear in system profiler.
    blue apple > about this mac > more info button. Click on the hardware line. It has a little triangle in front of the work hardware.
    look for firewire or usb.
    Robert

  • How can I get email receipt for my ipad2?

    Hi I bought IPAD2 from rockingham park apple store at June 25, 2011 . But I didn't get email  receipt for my IPAD2. How can I get email receipt for my ipad2 ? 

    I'm out of Country. I need reciept email for my IPAD2

  • Can you get "read receipts" on e mails

    Can you get "read receipts" on e mails?

    No, which can be prevented by default with the recipient's email client that supports this or by individual message when requested by the sender of a message.

  • How can I get read out loud to work on MAC for adobe reader?

    Having trouble getting the read out loud function to work on MAC.  It keeps says "BLANK" or "Warning Page Empty".  How can i get this resolved my the read out loud function to work properly?

    That depends.
    First, be sure the pdf isn't just scanned images. Can you select individual words with the select tool? If not, you would need to use a tool to run OCR before it can be read.

  • How can I get list properties using SharePoint CSOM

    Hi Team,
    I am using SharePoint CSOM to read SharePoint Discussion board.I need discussion discription and created by and Discussion list Title etc.
    But I am unable to read those. I saw below message for discussion list in immediate window while debugging.
    DiscussionList
    {Microsoft.SharePoint.Client.List}
    base {Microsoft.SharePoint.Client.SecurableObject}: {Microsoft.SharePoint.Client.List}
    AllowContentTypes: 'DiscussionList.AllowContentTypes' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    BaseTemplate: 'DiscussionList.BaseTemplate' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    BaseType: 'DiscussionList.BaseType' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    BrowserFileHandling: 'DiscussionList.BrowserFileHandling' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    ContentTypes: {Microsoft.SharePoint.Client.ContentTypeCollection}
    ContentTypesEnabled: 'DiscussionList.ContentTypesEnabled' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    Created: 'DiscussionList.Created' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    DataSource: 'DiscussionList.DataSource' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    DefaultContentApprovalWorkflowId: 'DiscussionList.DefaultContentApprovalWorkflowId' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    DefaultDisplayFormUrl: 'DiscussionList.DefaultDisplayFormUrl' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    DefaultEditFormUrl: 'DiscussionList.DefaultEditFormUrl' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    DefaultNewFormUrl: 'DiscussionList.DefaultNewFormUrl' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    DefaultViewUrl: 'DiscussionList.DefaultViewUrl' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    Description: 'DiscussionList.Description' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    Direction: 'DiscussionList.Direction' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    DocumentTemplateUrl: 'DiscussionList.DocumentTemplateUrl' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    DraftVersion
    EffectiveBasePermissions: 'DiscussionList.EffectiveBasePermissions' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    EnableAttachments: 'DiscussionList.EnableAttachments' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    EnableFolderCreation: 'DiscussionList.EnableFolderCreation' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    EnableMinorVersions: 'DiscussionList.EnableMinorVersions' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    EnableModeration: 'DiscussionList.EnableModeration' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    EnableVersioning: 'DiscussionList.EnableVersioning' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    Fields: {Microsoft.SharePoint.Client.FieldCollection}
    ForceCheckout: 'DiscussionList.ForceCheckout' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    Forms: {Microsoft.SharePoint.Client.FormCollection}
    HasExternalDataSource: 'DiscussionList.HasExternalDataSource' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    Hidden: 'DiscussionList.Hidden' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    Id: 'DiscussionList.Id' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    ImageUrl: 'DiscussionList.ImageUrl' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    IsApplicationList: 'DiscussionList.IsApplicationList' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    IsCatalog: 'DiscussionList.IsCatalog' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    IsSiteAssetsLibrary: 'DiscussionList.IsSiteAssetsLibrary' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    ItemCount: 'DiscussionList.ItemCount' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    LastItemDeletedDate: 'DiscussionList.LastItemDeletedDate' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    LastItemModifiedDate: 'DiscussionList.LastItemModifiedDate' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    MultipleDataList: 'DiscussionList.MultipleDataList' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    NoCrawl: 'DiscussionList.NoCrawl' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    OnQuickLaunch: 'DiscussionList.OnQuickLaunch' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    ParentWeb: {Microsoft.SharePoint.Client.Web}
    ParentWebUrl: 'DiscussionList.ParentWebUrl' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    RootFolder: {Microsoft.SharePoint.Client.Folder}
    SchemaXml: 'DiscussionList.SchemaXml' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    ServerTemplateCanCreateFolders: 'DiscussionList.ServerTemplateCanCreateFolders' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    TemplateFeatureId: 'DiscussionList.TemplateFeatureId' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    Title: 'DiscussionList.Title' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    UserCustomActions: {Microsoft.SharePoint.Client.UserCustomActionCollection}
    ValidationFormula: 'DiscussionList.ValidationFormula' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    ValidationMessage: 'DiscussionList.ValidationMessage' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'
    Views: {Microsoft.SharePoint.Client.ViewCollection}
    WorkflowAssociations: {Microsoft.SharePoint.Client.Workflow.WorkflowAssociationCollection}
    Please let me know how can I get all discussion Properties.
    Krishnasandeep

    Here is the code snippet which is working
    ClientContext Context = new ClientContext(siteurl);
    Context.AuthenticationMode = ClientAuthenticationMode.Default;
    List DiscussionList = Context.Web.Lists.GetByTitle("4gl-adapter");
    CamlQuery query = CamlQuery.CreateAllFoldersQuery();
    ListItemCollection itemCollection = DiscussionList.GetItems(query);
    Context.Load(itemCollection);
    Context.ExecuteQuery();
    foreach (ListItem thread in itemCollection)
    string threadTitle = thread["Title"].ToString();
    string threadBody = thread["Body"].ToString();
    But if try to below code,
    String DiscussionDesc = DiscussionList.Description;
    I am getting exception.
    Let me know if I am doing wrong anywhere.
    Krishnasandeep

  • How can I get a receipt ?

    I bought the mac book air 11" in online few days ago, but I received only confirmation.
    And I want to get a receipt about my purchase.
    How can I get it?

    Call Apple.

  • How can I get file name using JSTL ?

    Hi,
    I'm now using <c:out value="${pageContext.request.requestURI}"/>
    this return servlet path
    How can I get just file name
    or user path (in location bar) ?
    thanks in advance

    The original uri (before forwarding) is available in a request scoped attribute.
    These attributes are given the values obtained by calling the related method on the original request received by the container.
    javax.servlet.forward.request_uri
    javax.servlet.forward.context_path
    javax.servlet.forward.servlet_path
    javax.servlet.forward.path_info
    javax.servlet.forward.query_stringSo if those two above don't work for you these might.
    <c:out value="${requestScope['javax.servlet.forward.request_uri']}"/>
    <c:out value="${requestScope['javax.servlet.forward.servlet_path']}"/>If these values are null, then the value in the request object is the correct one.
    You mentioned the value in the address bar being a .html file. Do you perchance use framesets? If so the value in the address bar is always the url used to load the frameset, and doesn't change no matter where you travel within those frames. That won't be available to the server, because it has nothing to do with the current request.
    Cheers,
    evnafets

  • How can i get the port used for https

    Hi All,
    does aynbody knows how can i get in the portal the port used for https connection, cause the link send by e-mail notification, when user has been invited in a room doesnt work...
    i tried to use the command netstat -ao and i tried use the port that i get there.. but then i get message, when click on the link: "The page cannot be displayed"
    we have following settings:
    server port: ??
    Web Protocol: https://
    Thanks for suggestions!
    Karol

    Hi Karol,
    by navigating to:
    Content Administration -> Collaboration Content -> (Room Administration -> Related Topics) -> Configure Backend Properties for Rooms
    you can change the Webprotocol to http:// and set server port to 50000 (default port).
    To see the SSL Port you can go in the Visual Administrator to Services -> "HTTP Provider Services".
    http://help.sap.com/saphelp_nw04/helpdata/en/a2/f9d7fed2adc340ab462ae159d19509/frameset.htm
    Hope this helps,
    Robert

Maybe you are looking for