Results 1 to 12 of 12
  1. #1
    irakli_dev is offline Member
    Join Date
    Dec 2011
    Location
    Tbilisi (Georgia)
    Posts
    24
    Rep Power
    0

    Default question in javaMail

    i sending mail with javaMail, i did all, sending attachment but i can't add signature to mail text,
    anyone can suggest how to do this? and if pssible show it

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default Re: question in javaMail

    I think this should done by the mail client you have. As far as I remember JavaMail doesn't have a direct way to do that. Enable the signature on your mail client and try.

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default Re: question in javaMail

    BTW, if your content is text/plain then adding signature into it make your mail content like multipart. It can cause lots of issues on your implementations later.

  4. #4
    irakli_dev is offline Member
    Join Date
    Dec 2011
    Location
    Tbilisi (Georgia)
    Posts
    24
    Rep Power
    0

    Default Re: question in javaMail

    yes i have multipart, this is part of my code:

    Java Code:
       BodyPart messageBodyPart = new MimeBodyPart();
                messageBodyPart .setContent(text,"text/html;charset=UTF-8");
                Multipart multipart = new MimeMultipart();
           
                multipart.addBodyPart(messageBodyPart);
    
                messageBodyPart = new MimeBodyPart();
    
                DataSource source = new FileDataSource(filename);
    
                messageBodyPart.setDataHandler(new DataHandler(source));
                messageBodyPart.setFileName(MimeUtility.encodeWord(attachedName, "utf-8", "Q"));
                multipart.addBodyPart(messageBodyPart);
    but what i should add to add text in the left bottom side?
    Last edited by Eranga; 03-07-2012 at 08:45 AM. Reason: code tags added

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default Re: question in javaMail

    Quote Originally Posted by irakli_dev View Post
    but what i should add to add text in the left bottom side?

    Left bottom side means the signature?

  6. #6
    irakli_dev is offline Member
    Join Date
    Dec 2011
    Location
    Tbilisi (Georgia)
    Posts
    24
    Rep Power
    0

    Default Re: question in javaMail

    yes signature, i mean if there isn't such term "signature" then i could add text on the left bottom to make such affect as it's signature or i can otherwise add signature?

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default Re: question in javaMail

    Did you try what I am said with the mail client.

    In general you can attach part of the text at the end to the content as the signature, either in HTML or text.

  8. #8
    irakli_dev is offline Member
    Join Date
    Dec 2011
    Location
    Tbilisi (Georgia)
    Posts
    24
    Rep Power
    0

    Default Re: question in javaMail

    from this computer i can't send mails from gmail because proxy isn't allowing me, later i will try, thx for advice it would be good decision

  9. #9
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

  10. #10
    irakli_dev is offline Member
    Join Date
    Dec 2011
    Location
    Tbilisi (Georgia)
    Posts
    24
    Rep Power
    0

    Default Re: question in javaMail

    hello
    i tryed to add signature in mail client, but it don't work for mails from javaMail but i will add signature manually, when i will send mail i will add signature text to the left bottom of the mail

  11. #11
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default Re: question in javaMail

    In general signature is just another text bulk. Difference is that the mail client automatically handles based on your configurations. You can do the same with the JavaMail too, manually as you did.

    Is that your mail client configured properly?

  12. #12
    irakli_dev is offline Member
    Join Date
    Dec 2011
    Location
    Tbilisi (Georgia)
    Posts
    24
    Rep Power
    0

    Default Re: question in javaMail

    i sending mail via Gmail and i configure signature in Gmail Setting->setting and when i sending mail from Gmail signature is visable but from JavaMail it's not sending, may i should add to my code to send with singature?

Similar Threads

  1. Trying JavaMail
    By fred2028 in forum Networking
    Replies: 0
    Last Post: 09-27-2011, 03:51 PM
  2. Help with javamail ??
    By nikunj in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 02-02-2011, 12:12 PM
  3. Javamail
    By johniem in forum New To Java
    Replies: 0
    Last Post: 07-14-2010, 03:00 PM
  4. Javamail
    By v_mallikarjun in forum Advanced Java
    Replies: 14
    Last Post: 04-18-2008, 07:32 PM
  5. This is Regarding JSP with javamail
    By venkatkomalli in forum Advanced Java
    Replies: 3
    Last Post: 07-19-2007, 02:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •