• Post Reply Bookmark Topic Watch Topic
  • New Topic

Wap Email

 
shahjahan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had built an application for sending email from wap. when i upload in site. and browser by wap phone and when i submit go it gives me an error.
url of the site is : http://mywaphosting.com/users/terradi/email.wml

The code:
import java.oi.IOException;
import java.util.Properties;
import javax.mail.*;
import javax.mail.intenet.*;
import javax.servelt.*;
import javax.servlet.http.*;
import com.shah.util.WML;
public class WAPOrderConfirmation extends httpservlet {

public void doPost (HttpServletRequest request, HttpServletResponse response)
throws ServleetException, IOException{

String host = "digitaldocumentsonline.com";
String from ="sales@terradi.com";
String to = request.getParameter("email");
String subject = "Your order with Digital Documents Online";
StringBuffer text = new StringBuffer();

text.append("Thank you for ordering from Digital Documents Onlone");
text.append("\n\n");
text.append("If you need to get in touch with us about your order");
text.append("please send an e-mail message to sales@digitaldocumentsonline.com");
text.append("(or just reply to this message)");
text.append("Please note that you can view the stautus of your account and");
text.append("orders,cancel undispatched orders, and changet he");
text.append("delivery or invoice information for undispatched order at");
text.append("any time though \"MY Account\" link in the side");
text.append("panel of our Web site.");
text.append("\n\n");
text.append("sales@digitaldocumentsonline.com \t htptp://www.digitaldocumentsonline.com");
try{
//Get system properties
Properties props = System.getProperties();

//Setup mail server
props.put('mail.smtp.host", host);

//Get session
Session session = Session.getInstance(props, null);
session.setDebug(false);

//Define message
MimeMessage message= new Mimemessage(session);
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
message.setSubject(subject);
message.setText(text.tostring() );

//Send message
Transport.send(message);

WML wml= new WML();
wml.addCard("OrderSent", "Order Sent");
wml.println("<p align=\"center\">" +
"Thank you for your order! " +
"</p>");
wml.endCard();
wml.outputWML9response, false);

}catch (Exception e){
e.printStackTrace();
}
}
}
 
Rob Ross
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"shahjahan",
Please change your name to comply with the naming policy to which you agreed when you registered here..

For your publicly displayed name,
use a first name, a space, and a last name.

You can change your name here:
here

You can also find the naming policy here:
http://www.javaranch.com/name.jsp
Thank You!
[ June 30, 2002: Message edited by: Rob Ross ]
 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by shahjahan:
I had built an application for sending email from wap. when i upload in site. and browser by wap phone and when i submit go it gives me an error.
url of the site is : http://mywaphosting.com/users/terradi/email.wml

The code:
import java.oi.IOException;
import java.util.Properties;
import javax.mail.*;
import javax.mail.intenet.*;
import javax.servelt.*;
import javax.servlet.http.*;
import com.shah.util.WML;
public class WAPOrderConfirmation extends httpservlet {

public void doPost (HttpServletRequest request, HttpServletResponse response)
throws
ServleetException

maybe this is where one of the problem is...change it to "ServletException"
hth
malhar
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!