473,395 Members | 1,443 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Sending from a Java Software to a email!

1
Hi

I have a problem sending this information

Expand|Select|Wrap|Line Numbers
  1.  
  2. private void postFormToServer() throws Exception {
  3.   String address = UtilityStore.WBW_SERVER;
  4.         URL url = http://myadress.com/send_mail.php;
  5.         URLConnection connection = url.openConnection();
  6.         connection.setDoOutput(true);
  7.         if(connection instanceof HttpURLConnection) {
  8.          ((HttpURLConnection)connection).setRequestMethod("POST");
  9.         }
  10.         OutputStreamWriter streamWriter = new OutputStreamWriter(connection.getOutputStream());
  11.         streamWriter.write(customerNameField + SEPARATOR + customerInfoField + SEPARATOR + emailField);
  12.         streamWriter.close();
  13.  }
  14.  
to this page

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. $to = "my mail@gmail.com";
  4. $emailField= $_POST["emailField"];
  5. $subject= $_POST["subject"];
  6. $customerNameField= $_POST["customerNameField"];
  7. $customerInfoField= $_POST["customerInfoField"];
  8.  
  9. if (mail ($to, $subject, $customerInfoField ,"From: $customerNameField <$emailField>"))
  10.  
  11. echo nl2br("<h2>Sent!</h2> 
  12. <b>mottagare:</b> $to
  13. <b>ämne:</b> $subject
  14. <b>meddelande:</b>
  15. $customerInfoField
  16. ");
  17.  
  18. else
  19. echo "No";
  20.  
  21. ?>
  22.  
Its just not sending the mail, but Im not getting any errors.
Apr 19 '10 #1
0 971

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: yaron | last post by:
Hi, I have a problem when sending data over TCP socket from c# client to java server. the connection established ok, but i can't send data from c# client to java server. it's work ok with...
1
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to...
7
by: D. Patrick | last post by:
I need to duplicate the functionality of a java applet, and how it connects to a remote server. But, I don't have the protocol information or the java source code which was written years ago. ...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
0
by: systemania.com | last post by:
We have 3 contract positions open in Herndon Virginia for 3 JAVA/J2EE Developers. The contracts are Long Term (1 year ++). The rate is $45/h negotiable based on experience. To apply for this...
15
by: Xah Lee | last post by:
On Java's Interface Xah Lee, 20050223 In Java the language, there's this a keyword ā€œinterfaceā€. In a functional language, a function can be specified by its name and parameter specs....
7
by: undbund | last post by:
Hi I am creating a newsletter system. The software should run from desktop computer (localhost) but be able to send email to anyone on the internet. Can you guys give me some ideas on how to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.