Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: html/java form to email help, please!

  1. #1
    Junior Member
    Join Date
    Nov 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation html/java form to email help, please!

    I apologize if I've posted in the wrong section. I'm looking for some java help. I am not at all a java programer or able to write scripts from scratch, so I'd appreciate it if someone can help and answer me! I am fluent with many other languages so I can edit a javascript without causing a splat, but writing...I can not.

    I am trying to build an html form that sends an email and allows the user to type in their own custom subject in a text field on the form that ends up being the subject line that appears in the recipients email. How can this be done?

    I'm aware of how to do this in other languages but this form is going to run on an internal office LAN network, not online, so I think the best option that the network's security will allow is java. But I'm incapable of writting the script I need and thus far I've been unable to find one that does everything I want it to.

    - I don't need validation since it's going to run on an internal LAN network.
    - I don't want the submit button launching an email program. I just want it to send the message direct to the inbox(es) I'm designing the forms to send to.

    If someone here can help me by providing me with the script I need so the user can type their own subject that ends up being the subject line in the recipients inbox I would be too grateful to express with words!

    Is there a reason why this can't be done? Maybe that's why I can't find the script that does it...
    Last edited by Bort; November 20th, 2014 at 02:32 AM.


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    6,104
    My Mood
    Mellow
    Thanks
    244
    Thanked 755 Times in 741 Posts

    Default Re: html/java form to email help, please!

    Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for new members.

    Please do not post multiple threads on the same topic. Your other thread was removed.

    JavaScript != Java

    Folks here will not write code for you, unless possibly you were to post a paid gig for it.

  3. #3
    Junior Member
    Join Date
    Nov 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: html/java form to email help, please!

    That's helpful, thank you. I knew of the code box and tried to use it but when I submitted it with the code it told me I was trying to do something the forums didn't allow, didn't know the code box was different here. I do have a code I just need help with it. Hopefully someone will help edit it?

    <html>
    <head><SCRIPT LANGUAGE="JavaScript">
    function msg() {
    document.mailer.action = "mailto:" 
    mailtoandsubject = ((document.mailer.mailtoperson.options[document.mailer.mailtoperson.selectedIndex].value) + '?subject=' + document.mailer.subject.value); 
    } 
    </SCRIPT>
     
    </HEAD>
     
    <FORM NAME="mailer" METHOD="post" ACTION="" ENCTYPE="text/plain" 
    onSubmit="(document.mailer.action += mailtoandsubject)"> 
    <TABLE BORDER=0>
    <TR VALIGN="top">
    <TD>Recipient:</TD>
    <TD><SELECT NAME="mailtoperson" onChange="msg(this.form)">
    <OPTION VALUE="">-- Select --
    <OPTION VALUE="emaillink1@yourdomain.com">Link1
    <OPTION VALUE="emaillink2@yourdomain.com">Link2
    <OPTION VALUE="emaillink3@yourdomain.com">Link3
    </SELECT></TD>
    </TR>
    <TR VALIGN="top">
    <TD>Your Name:</TD>
    <TD><INPUT TYPE="text" SIZE=45 NAME="name" onChange="msg(this.form)"></TD>
    </TR>
    <TR VALIGN="top">
    <TD>Your Email:</TD>
    <TD><INPUT TYPE="text" SIZE=45 NAME="email" onChange="msg(this.form)"></TD>
    </TR>
    <TR VALIGN="top">
    <TD>Priority:</TD>
    <TD>
    <SELECT NAME="priority" onChange="msg(this.form)">
    <OPTION VALUE="Normal">Normal
    <OPTION VALUE="Urgent">Urgent
    <OPTION VALUE="No Reply Needed">No reply needed
    </SELECT></TD>
    </TR>
    <TR VALIGN="top">
    <TD>Subject:</TD>
    <TD><INPUT TYPE="text" SIZE=45 NAME="subject" onChange="msg(this.form)"></TD>
    </TR>
    <TR VALIGN="top">
    <TD>Message:</TD>
    <TD><TEXTAREA NAME="message" COLS=45 ROWS=5 WRAP="virtual" OnChange="msg(this.form)"></TEXTAREA></TD>
    </TR>
    <TR>
    <TD> </TD>
    <TD><INPUT TYPE="submit" VALUE="Send Message">
    <INPUT TYPE="reset" VALUE="Reset"></TD>
    </TR>
    </TABLE>
    </FORM>

    How do I get this to just send the mail without launching the users default email program?

Similar Threads

  1. Convert html to an image (png) for Email delivery
    By gradstudent in forum What's Wrong With My Code?
    Replies: 0
    Last Post: January 15th, 2014, 03:47 PM
  2. Java Code Send email from email id configured in outlook
    By Hrithik in forum Java Theory & Questions
    Replies: 0
    Last Post: September 21st, 2012, 03:41 AM
  3. Replies: 1
    Last Post: November 25th, 2011, 11:07 AM
  4. Replies: 10
    Last Post: July 12th, 2011, 03:27 PM
  5. Any way to write html form data to file?
    By nathan.fortier@gmail.com in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: January 14th, 2011, 03:03 PM