dcsimg
www.webdeveloper.com
Results 1 to 5 of 5

Thread: send dataa to email

  1. #1
    Join Date
    Feb 2004
    Posts
    47

    Unhappy send dataa to email

    i face a problem here. for your information, i'm using jsp to handle my wen site. the problem is i have created list box in my web page. i am able successfully enter the data selected in database(mysql). the data that was inserted in database is code that represent the detail in the list box. for example, when i choose 'apartment' from list box, 'AP' will be inserted into database. i can do all these except how can i send the information to email. i know how to send email but when the recepient receive, they will get the code data. For example, they will get 'AP' instead of 'apartment'. how can i send the full word to email???

    below is some part of my coding:<option selected="selected" value="done">--Select--</option>
    <% String select_2 = "SELECT smd_cde2_typ, smd_cde2, smd_cde2_desc "+
    "FROM smcde2 "+
    "WHERE smd_cde2_typ = 'T' "+
    "ORDER BY smd_cde2_desc ";
    Statement stmt_2 = conn.createStatement();
    ResultSet rset_2 = stmt_2.executeQuery(select_2);
    while (rset_2.next()) {
    property_code = rset_2.getString("smd_cde2");
    property_desc = rset_2.getString("smd_cde2_desc");%>
    <option value="<%=property_code%>"><%=property_desc%></option>
    <% } %>
    </select>

  2. #2
    Join Date
    Apr 2004
    Posts
    21
    can you post the code you are using to create and send the email?

  3. #3
    Join Date
    Feb 2004
    Posts
    47

    Unhappy

    below are the send mail code:


    <% try {
    Properties props = new Properties();
    Session sendMailSession;
    Store store;
    Transport transport;
    sendMailSession = Session.getInstance(props, null);
    props.put("mail.smtp.host", "smtp.arc.net.my");
    //props.put("mail.smtp.host", "smtp.brunsfield.com.my");
    Message newMessage = new MimeMessage(sendMailSession);
    //String to = "b_ehomes@yahoo.com";
    //newMessage.setFrom(new InternetAddress(request.getParameter("from")));
    //newMessage.setFrom(new InternetAddress("chinjil@hotmail.com"));
    //newMessage.setRecipient(Message.RecipientType.TO, new InternetAddress("jilshi@hotmail.com"));
    newMessage.setRecipient(Message.RecipientType.BCC, new InternetAddress("jilshi@hotmail.com"));
    newMessage.setSubject("send buyer information");
    String nme, new_icNum, old_icNum, addr1, addr2, addr3, postcode, postcity, post_state,
    post_country, home_phone, hand_phone, office_phone, office_fax, email, occupation,
    property_desc, property_code, property_type, comMsg ;

    nme = (String)session.getAttribute("nme");
    out.print(nme);

    addr1 = (String)session.getAttribute("addr1");
    out.print(addr1);

    addr2 = (String)session.getAttribute("addr2");
    out.print(addr2);

    addr3 = (String)session.getAttribute("addr3");
    out.print(addr3);

    occupation = (String)session.getAttribute("occupation");
    out.print(occupation);

    email = (String)session.getAttribute("email");
    out.print(email);

    postcode = (String)session.getAttribute("postcode");
    out.print(postcode);
    session.setAttribute("postcodee", postcode);

    postcity = (String)session.getAttribute("postcity");
    out.print(postcity);

    post_state = (String)session.getAttribute("post_state");
    out.print(post_state);

    post_country = (String)session.getAttribute("post_country");
    out.print(post_country);

    home_phone = (String)session.getAttribute("home_phone");
    out.print(home_phone);

    hand_phone = (String)session.getAttribute("hand_phone");
    out.print(hand_phone);

    office_phone = (String)session.getAttribute("office_phone");
    out.print(office_phone);

    office_fax = (String)session.getAttribute("office_fax");
    out.print(office_fax);

    new_icNum = (String)session.getAttribute("new_icNum");
    out.print(new_icNum);

    old_icNum = (String)session.getAttribute("old_icNum");
    out.print(old_icNum);

    property_type = (String)session.getAttribute("property_type");
    out.print(property_type);

    comMsg = nme +'\n'+ addr1 +'\n'+addr2+'\n'+addr3+'\n'+ occupation +'\n'+email+
    '\n'+postcode+'\n'+ postcity +'\n'+post_state+'\n'+post_country+'\n'+
    home_phone +'\n'+hand_phone+'\n'+ office_phone +'\n'+office_fax+'\n'+
    new_icNum+'\n'+ old_icNum+'\n'+ property_type ;

    //newMessage.setSentDate(new Date());
    newMessage.setText(comMsg);
    transport = sendMailSession.getTransport("smtp");
    transport.send(newMessage); %>


  4. #4
    Join Date
    Apr 2004
    Posts
    21
    is this page somewhere we can view it?
    url please.

  5. #5
    Join Date
    Feb 2004
    Posts
    47

    Unhappy

    i test my program in local area network. i will upload my program when it is successful completed in LAN. sorry because i dont have the url since i have not upload

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles