email with attachment example issues

Posted on 2012-09-04
Last Modified: 2012-09-08
I am workling on following example

I am wondering If i need to do any set up to run this exampe.

what are the values i need to give for host from to etc fields.

Do i need to specify relative or absolute path for the attachment.

Any ideas, suggestions, sample code, links, source code highly appreciated. Thanks in advance
Question by:gudii9
    LVL 20

    Accepted Solution

    Host will be the SMTP Server (that is used to send the mails)
    From will be the email id of Sender
    To will be the email id of Receiver

    Please refer the below link that uses the SMTP server of gmail.

    Alongwith the above, you will have to use the username/password of your email account.
    LVL 10

    Assisted Solution

    by:Pramod Kumar
    The sample code you are referring is built with default values like:

    1. The smtp server may or may not require authentication before sending.
    2. The smtp server's default port is 25 but can be different server to server.

    You should be sure about these default values as per your SMTP server.

    I have posted my sample for you in your another same query thread:

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
    Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
    Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now