Trouble in sending mail-jsp

<%@ page import="javax.mail.*, javax.mail.event.*, javax.mail.internet.*, java.util.*" %>
<%
Properties prop=new Properties();
prop.put("mail.smtp.host","smtp.mail.yahoo.co.uk");
Session s= Session.getInstance(prop);
MimeMessage message=new MimeMessage(s);
InternetAddress from = new InternetAddress("[email protected]");
message.setFrom(from);
InternetAddress to = new InternetAddress("[email protected]");
message.addRecipient(Message.RecipientType.TO, to);
message.setSubject("hello");
Store store=s.getStore("pop3");
store.connect("pop.mail.yahoo.co.uk", "aniketh_parmar", "*******");
Transport.send(message);
store.close();
%>
<html>
<head><title>Mail Sent</title></head>
<body>
Mail Sent. <a hrf="http://mail.yahoo.com">Check Your Mail</a>
To send 1 more mail <a hef="sendemail.jsp">Click Here</a>
</body>
</html>
When I run my file I get following errors:
javax.servlet.ServletException: 530 authentication required - for help go to http://help.yahoo.com/help/us/mail/pop/pop-11.html
     at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:498)
     at org.apache.jsp.sendemail_jsp._jspService(sendemail_jsp.java:72)
     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162)
     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:198)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:138)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954)
     at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2459)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:132)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595)
     at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:593)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:593)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:126)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954)
     at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
     at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
     at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
     at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
     at java.lang.Thread.run(Thread.java:619)
root cause
com.sun.mail.smtp.SMTPSendFailedException: 530 authentication required - for help go to http://help.yahoo.com/help/us/mail/pop/pop-11.html
     at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388)
     at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:959)
     at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:583)
     at javax.mail.Transport.send0(Transport.java:151)
     at javax.mail.Transport.send(Transport.java:80)
     at org.apache.jsp.sendemail_jsp._jspService(sendemail_jsp.java:64)
     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162)
     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:198)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:138)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954)
     at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2459)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:132)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595)
     at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:593)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:593)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:126)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954)
     at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
     at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
     at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
     at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
     at java.lang.Thread.run(Thread.java:619)
Message was edited by:
aniketh_parmar
Message was edited by:
aniketh_parmar
Message was edited by:
aniketh_parmar
Message was edited by:
aniketh_parmar
Message was edited by:
aniketh_parmar

This is how I changed the code
<%@ page import="javax.mail.*, javax.mail.event.*, javax.mail.internet.*, java.util.*" %>
<%
Properties prop=new Properties();
prop.put("mail.smtp.host","smtp.mail.yahoo.com");
Session s= Session.getInstance(prop);
MimeMessage message=new MimeMessage(s);
InternetAddress from = new InternetAddress("[email protected]");
message.setFrom(from);
InternetAddress to = new InternetAddress("[email protected]");
message.addRecipient(Message.RecipientType.TO, to);
message.setSubject("hello");
message.setText("dsfsnmkmnvkcsd");
Store store=s.getStore("pop3");
store.connect("pop.mail.yahoo.com", "anikethparmar", "hellohello");
String protocol = "smtp";
prop.put("mail." + protocol + ".auth", "true");
Transport t = s.getTransport(protocol);
try {
t.connect("anikethparmar", "mypassword");
t.sendMessage(message, message.getAllRecipients()); // In place of message.getAllRecipient I tried putting the email id: Still didnt worked
} finally {
t.close();
store.close();
%>
<html>
<head><title>Mail Sent</title></head>
<body>
Mail Sent. <a hrf="http://mail.yahoo.com">Check Your Mail</a>
To send 1 more mail <a hef="sendemail.jsp">Click Here</a>
</body>
</html>
Error which I get is
ype Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: invalid user/password
     at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:498)
     at org.apache.jsp.sendemail1_jsp._jspService(sendemail1_jsp.java:84)
     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162)
     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:198)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:138)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954)
     at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2459)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:132)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595)
     at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:593)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:593)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:126)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954)
     at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
     at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
     at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
     at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
     at java.lang.Thread.run(Thread.java:619)
root cause
javax.mail.AuthenticationFailedException: invalid user/password
     at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:146)
     at javax.mail.Service.connect(Service.java:236)
     at javax.mail.Service.connect(Service.java:137)
     at org.apache.jsp.sendemail1_jsp._jspService(sendemail1_jsp.java:64)
     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162)
     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:198)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:138)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954)
     at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2459)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:132)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595)
     at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:593)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:593)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:126)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954)
     at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
     at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
     at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
     at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
     at java.lang.Thread.run(Thread.java:619)
Please help I am stucked up..... I cannot proceed...............
null
null

Similar Messages

  • Trouble with Sending Mails with forms 6i on a Citrix Environment

    I have a problem, cause i tryed to use the guide`s that i found in the forum, but using this code:
    PACKAGE mail_pkg IS
    /* paquete sacado de internet: UTL_SMTP package */
    session OLE2.OBJ_TYPE; /* OLE object handle */
    args OLE2.LIST_TYPE; /* handle to OLE argument list */
    procedure logon( Profile IN varchar2 default NULL );
    procedure logoff;
    procedure send( Recp IN varchar2,
    Subject IN varchar2,
    Text IN varchar2,
    Attch IN varchar2
    END;
    PACKAGE BODY mail_pkg IS
    session_outbox OLE2.OBJ_TYPE;
    session_outbox_messages OLE2.OBJ_TYPE;
    message1 OLE2.OBJ_TYPE;
    msg_recp OLE2.OBJ_TYPE;
    recipient OLE2.OBJ_TYPE;
    msg_attch OLE2.OBJ_TYPE;
    attachment OLE2.OBJ_TYPE;
    procedure logon( Profile IN varchar2 default NULL )is
    Begin
    session := ole2.create_obj('mapi.session');
    /* create the session object */
    args := ole2.create_arglist;
    ole2.add_arg(args,Profile);/* Specify a valid profile name */
    ole2.invoke(session,'Logon',args);
    /* to avoid the logon dialog box */
    ole2.destroy_arglist(args);
    End;
    procedure logoff is
    Begin
    ole2.invoke(session,'Logoff');
    /* Logoff the session and deallocate the */
    /* resources for all the OLE objects */
    ole2.release_obj(session);
    ole2.release_obj(session_outbox);
    ole2.release_obj(session_outbox_messages);
    ole2.release_obj(message1);
    ole2.release_obj(msg_recp);
    ole2.release_obj(recipient);
    ole2.release_obj(msg_attch);
    ole2.release_obj(attachment);
    End;
    procedure send( Recp IN varchar2,
    Subject IN varchar2,
    Text IN varchar2,
    Attch IN varchar2
    )is
    Begin
    /* Add a new object message1 to the outbox */
    session_outbox := ole2.get_obj_property(session,'outbox');
    session_outbox_messages := ole2.get_obj_property(session_outbox,'messages');
    message1 := ole2.invoke_obj(session_outbox_messages,'Add');
    ole2.set_property(message1,'subject',Subject);
    ole2.set_property(message1,'text',Text);
    /* Add a recipient object to the message1.Recipients collection */
    msg_recp := ole2.get_obj_property(message1,'Recipients');
    recipient := ole2.invoke_obj(msg_recp,'add') ;
    ole2.set_property(recipient,'name',Recp);
    ole2.set_property(recipient,'type',1);
    ole2.invoke(recipient,'resolve');
    /* Add an attachment object to the message1.Attachments collection */
    msg_attch := ole2.get_obj_property(message1,'Attachments');
    attachment := ole2.invoke_obj(msg_attch,'add') ;
    ole2.set_property(attachment,'name',Attch);
    ole2.set_property(attachment,'position',0);
    ole2.set_property(attachment,'type',1); /* 1 => MAPI File Data */
    ole2.set_property(attachment,'source',Attch);
    /* Read the attachment from the file */
    args := ole2.create_arglist;
    ole2.add_arg(args,Attch);
    ole2.invoke(attachment,'ReadFromFile',args);
    ole2.destroy_arglist(args);
    args := ole2.create_arglist;
    ole2.add_arg(args,1); /* 1 => save copy */
    ole2.add_arg(args,0); /* 0 => no dialog */
    /* Send the message without any dialog box, saving a copy in the Outbox */
    ole2.invoke(message1,'Send',args);
    ole2.destroy_arglist(args);
    --message('Correo Electrónico Enviado Correctamente');
    End;
    END;
    I have an error when I try to send a mail, i create a pdf file, and just after appears this message:
    FRM-40735: WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA-305500
    I use a Citrix environment, but if I use local applicattion, in my machine, without citrix, It send the e-mail correctly.
    Any help??
    Please...

    Duane,
    don't knowwhy you chose to extend VButton, but the following code works for me. Note that I extend the VBean class. Also I am using Jinitiator 1.3.1.9 (this is what I had available for testing). My first test chowed that there was a problem with the way you specify teh URL string, which is why I harcoded the URL string when building the URL.
    Another issue when running it is that you need to sign the file because it needs socket permission (at least this was the error shown on a remote client).
    Here's the code
    package mypackage3;
    import oracle.forms.ui.*;
    import oracle.forms.properties.ID;
    import java.net.URL;
    import java.applet.*;
    import javax.swing.JTextField;
    import oracle.forms.handler.IHandler;
    public class Class1 extends VBean {
    public final static ID PLAY = ID.registerProperty("PLAY");
    private IHandler mHandler = null;
    public Class1()
    super();
    public void init(IHandler handler)
    mHandler = handler;
    super.init(handler);
    public boolean setProperty(ID property, Object value) {
    if (property == PLAY)
    try
    System.out.println("before soundplay");
    URL sou = new URL("http://fnimphiu-lap.de.oracle.com/forms60java/Drums.wav");
    System.out.println("1");
    //Applet testapp = new Applet();
    Applet testapp = mHandler.getApplet();
    System.out.println("2");
    AudioClip clip = testapp.getAudioClip(sou);
    System.out.println("3");
    clip.play();
    System.out.println("after soundplay");
    return true;
    catch(Exception ex)
    ex.printStackTrace();
    return super.setProperty(property, value);
    Fran

  • SMTP Send mail

    Hi everybody
    I have a little trouble about send mail´s.
    I have got Lotus Notes Server and
    I can send diferents emails wiht PL/SQL, but I can´t see the subject.
    anybdoy know about of this trouble?
    Thanks.

    see the example procedure here i am using for lotunnotes it is working fine
    create or replace procedure send_mail(sender in varchar2,
    recipicent in varchar2,
    subject in varchar2,
    message in varchar2) is
    mail_conn utl_smtp.connection;
    begin
    mail_conn := utl_smtp.open_connection('mail ip ex 130.0.25.200');
    utl_smtp.helo(mail_conn, 'tpc.tatasteel.com');
    utl_smtp.mail(mail_conn, sender);
    utl_smtp.rcpt(mail_conn, recipicent);
    utl_smtp.open_data(mail_conn);
    utl_smtp.write_data(mail_conn, 'From:' || Sender || utl_tcp.CRLF);
    utl_smtp.write_data(mail_conn, 'To:' || recipicent || utl_tcp.CRLF);
    utl_smtp.write_data(mail_conn, 'Subject :' || subject || utl_tcp.CRLF);
    utl_smtp.write_data(mail_conn, utl_tcp.CRLF);
    utl_smtp.close_data(mail_conn);
    utl_smtp.quit(mail_conn);
    EXCEPTION
    WHEN utl_smtp.transient_error OR utl_smtp.permanent_error THEN
    utl_smtp.quit(mail_conn);
    raise_application_error(-20000,
    'Failed to send mail due to the following error: ' ||
    sqlerrm);
    end send_mail;
    if any problem send to [email protected]

  • Sending mail with multiple attachments in jsp

    hi .I wrote a code to send a mail in jsp.but now i need to send mails with multiple attachments.how can i send mail with multiple attachment.

    Create a separate MimeBodyPart object for each attachment, rather than reusing
    the same one over and over.

  • How to send mail using jsp program

    am very new to jsp and doing my final year project. i need to send mails using my jsp program.can anyone say wht to do that is wht to include to send mails using jsp program. n also a sample code to send mail using jsp program.
    Thanx in advance

    Use below script.
    <%@ page import="java.util.*, javax.mail.*, javax.mail.internet.*" %>
    <%
    Properties props = new Properties();
    props.put("mail.smtp.host", "mailserver.com");
    Session s = Session.getInstance(props,null);
    InternetAddress from = new InternetAddress("[email protected]");
    InternetAddress to = new InternetAddress([email protected]");
    MimeMessage message = new MimeMessage(s);
    message.setFrom(from);
    message.addRecipient(Message.RecipientType.TO, to);
    message.setSubject("Your subject");
    message.setText("Your text");
    Transport.send(message);
    %>{code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Need to send mail & upload files using JSP

    hi, got a lot of issues,.. just starting out as a developer.. so here goes.
    1st Need to send mail & upload files to server using JSP(tomcat).. an example to demo it would be nice.
    thanx in advance

    Look at this for email:
    http://forum.java.sun.com/thread.jspa?forumID=45&threadID=285950
    and go to:
    http://servlets.com/cos/
    for a package to upload files.

  • Need to Send Mail from JSP...

    Dear Team,
    I Need to Send Mail from JSP, have Designed user Interface to enter
    to, from, subject, and message text .
    Have Downloaded mail.jar and activate.jar file..... and placed in tomcat lib directory and WEBAPPS/WEB-INF/lib Directory too
    How do i send a mail to user ?
    do I require something else apart from things that i have mentioned?
    do i have to Configure SMTP, POP3 or Something like this....
    Now If I Create a object of Type MimeMessage and Set Recipient, from, subject and if i say transport.send(message) will this do My JOB???

    Dear Team,
    I Need to Send Mail from JSP, have Designed user
    Interface to enter
    to, from, subject, and message text .
    Have Downloaded mail.jar and activate.jar file.....
    and placed in tomcat lib directory and
    d WEBAPPS/WEB-INF/lib Directory too
    How do i send a mail to user ?
    do I require something else apart from things that i
    have mentioned?
    do i have to Configure SMTP, POP3 or Something like
    this....
    Now If I Create a object of Type MimeMessage and Set
    Recipient, from, subject and if i say
    transport.send(message) will this do My JOB???Yup! in addition to all the above i need to know my mail box outgoing mail server. and that's enough...... i am able to do that.
    Regards,
    Jagadeesh HS.

  • How to send mail in html format in jsp???

    Hello everybody,
    I have two jsp pages.In one page I have the heading like Date,Transaction.I am retriving data from my second jsp page.And I hae included the second jsp page to my first jsp page.How to send mail this content in html format.
    Thanks
    Srikant

    MimeMessage m = new MimeMessage(session);
    BodyPart messageBodyPart = new MimeBodyPart();
    messageBodyPart.setContent(content, "text/html");this if u need to send a mail content as html

  • Is anyone else having trouble sending mail?  I have a MobileMe subscription - not sure whether that is the problem.  The Port assigned to my mail account on my iMac has a different number for the one recommended by Apple, but I hesitate to change it.

    Is anyone else having trouble sending mail on an iMac running 10.6.8.  I get a messsage that the server can't be accessed.  Apple help suggests using a different port from the one that was originally set.  I have a Mobile Me account.  Any suggestions?

    I had major issues with the iPhone 4s battery, however it’s resolved.
    The tech who set the phone up at the Apple store did so with little training.
    if you have a mobile me account. First go and move all your data to the cloud by going on your computer and logging in at me.com/move. The cloud has replaced mobile me, so there is no need for those two accounts
    Also make sure that for any of your email accounts you set them up to fetch, not push. My tech person set them all to have the email servers push data to the phone. The new iphone4s antenna is extremely strong so it will continually try to access stuff that is pushed–***** a lot of battery life doing this. It makes it worse if you have exchange 2010 accounts. Something about changes made to exchange really suck battery life from devices that access such accounts.
    turning of locator and the push notifications from facebook--they have a lot!

  • How to send Mail in JSP

    Hi,
    I am newbee in Java, I want to send mail to different accounts using java from my website. Plz help me with working example. I am new to java.
    Thanks in advance,
    devom

    Thanks, but I want to send mail from my WEb page that is in JSP. The arcticle pointed out sends mail in core java. I already know how to send in Core java, but i want to send through JSP. Plz help me.
    Thanks in advance,
    Devom

  • JSP Send Mail Application, plz help

    Hi,
    I have written a jsp send mail application, but it is giving error that NoSuchProviderException. What to do? Plz help. I m sending the code as below:
    <%@ page import="java.util.*, javax.mail.*,javax.mail.internet.*" %>
    <html>
    <head>
    <title>E-Mail Us</title>
    </head>
    <body bgcolor="white" text="#003399" >
    <%
    if(request.getMethod().equals("POST") )
    boolean status = true;
    String mailServer ="SMTP_HOST";
    String fnm = request.getParameter("fnm");
    String lnm = request.getParameter("lnm");
    String facility = request.getParameter("facility");
    String subject = request.getParameter("select");
    String fromEmail = "[email protected]";
    String toEmail = "[email protected]";
    String bccEmail = "[email protected]";
    String contact =request.getParameter("select2");
    String way =request.getParameter("way");
    String messageEnter = request.getParameter("message");
    try
    Properties props = new Properties();
         props.put("mail.smtp.host", mailServer);
    props.put("mail.smtp.auth", "true");
    Session s = Session.getInstance(props,null);
    MimeMessage message = new MimeMessage(s);
    InternetAddress from = new InternetAddress(fromEmail);
    message.setFrom(from);
    InternetAddress to = new InternetAddress(toEmail);
         InternetAddress bcc = new InternetAddress(bccEmail);
         message.addRecipient(Message.RecipientType.TO, to);
    message.addRecipient(Message.RecipientType.BCC, bcc);
    message.setSubject(subject);
         message.setSentDate(new Date());
    message.setText(messageEnter);
         message.setText(way);
         message.setText(contact);
         message.setText(facility);
         message.setText(fnm);
         message.setText(lnm);
         Transport transport = s.getTransport(mailServer);
    transport.connect(mailServer, "USER", "PASSWORD");
    transport.sendMessage(message, message.getAllRecipients());
    transport.close();
    catch(NullPointerException n)
    System.out.println(n.getMessage() );
         out.println(n.getMessage());
    out.println("<br><br><br><br><center><b>"+"ERROR!!!"+"</b></center>");//you need to enter a message"+"</b></center>");
         out.println("<br><br><center><b>"+"You need to Enter a message"+"</b></center>");
    status = false;
    catch (Exception e)
    System.out.println(e.getMessage() );
         out.println("<br><br><br><br><center><b>"+"ERROR!!!"+"</b></center>");
    out.println("<br><br><center><b>"+"Your Message to " + toEmail +" and "+ bccEmail+ " failed, reason is: " + e);
    status = false;
    if (status == true)
    out.println("<br><br><center><b>"+"Your message to " + toEmail +" and "+ bccEmail+ " was sent successfully!"+"</b></center>");
    else
    %>
    <center>
    <h1>Contact Us</h1>
    <form method="post" name="mail" action="mail.jsp">
    <table border="0">
    <tr>
    <td><b>First Name :</b></td>
    <td><input type="text" name="fnm" size=24></td>
    </tr>
    <tr>
    <td><b>Last Name :</b></td>
    <td><input type="text" name="lnm" size=24></td>
    </tr>
    <tr>
    <td><b>Facility :</b></td>
    <td><input type="text" name="facility" size=24></td>
    </tr>
    <tr>
    <td><b>Subject :</b></td>
    <td> <select name="select">
              <option>-------------------------------</option>
    <option>Missing File</option>
    <option>Correction Issue</option>
    <option>Refer Us</option>
    <option>Miscellaneous</option>
    </select></td>
    </tr>
    <p>
    <tr>
    <td><b>Comments :</b></td>
    <td><textarea name="message" rows = "10" cols="50"></textarea></td>
    </tr>
    <tr>
    <td><b>Best way to contact :</b></td>
    <td>
    <select name="select2">
              <option>--------------</option>
              <option>Phone</option>
    <option>Email</option>
    <option>Fax</option>
    </select>
    <input type="text" name="way" size=24></td>
    </tr>
    </table>
    <p>
    <font face="Helvetica"><input type="submit"
    value="Submit" name="Command">
    </font>
    </form></center>
    <%
    %>
    </body>
    </html>

    Ur messaging server will not be up..
    regards
    shanu

  • Troubling sending mail. Wants me to pick another mail server?

    I'm having trouble sending mail through my MobileMe.
    I set up all the outgoing settings according to this:
    http://support.apple.com/kb/TS1152
    But my email still doesn't want to go out. I've run connection doctor and everything gets a green light. Any suggestions?

    I had a problem today, for some reason me.com had the mail message being sent from a different account than the one I used to create it in. I just deleted the message and did it again and it went the second time..maybe this helps maybe it dosn't.

  • How to send mail from jsp

    hi,
    i want to send mail from my jsp page.
    1) how can i do this
    2) do i need any mail server for doin this
    thanks
    regards
    manoj

    i want to send mail from my jsp page.
    1) how can i do this
    2) do i need any mail server for doin thisRead
    http://java.sun.com/developer/onlineTraining/JavaMail/
    Rather,
    try this:
    http://jakarta.apache.org/taglibs/doc/mailer-doc/mailer-1.1/index.html

  • Having trouble receiving Yahoo mail on iPhone 6 sending mail is no problem?

    Having trouble receiving Yahoo mail on iPhone 6 sending mail is no problem?

    Any chance you use two step verification on your Yahoo account? If you've ever had to enter a code that was text messaged to you when you log into your Yahoo account on a new computer, then two step verification is probably on.
    If that is the case, you'll have to generate an app specific password in the Yahoo web mail page and enter that as your password on your Apple Device instead of your standard password in Mail Settings.

  • Sending Mail from jsp

    Hi guys,
    can anyone help me out of this problem ??
    I have written a piece of code which sends mail from a jsp page.
    When I use the 'Recipient'(TO) as an address in the same domain
    (ie,<xxx>@<apeejaygroup.com>) it works fine.
    But when I use an address such as <xxx>@<rediffmail.com>
    the code gives an error like -
    "javax.mail.SendFailedException: Sending failed;
    nested exception is:
    javax.mail.SendFailedException: Invalid Addresses;
    nested exception is:
    javax.mail.SendFailedException: 550 5.7.1 ... Relaying denied"
    I am sending the piece of code for reference..
    String host ="192.168.33.11";
    String from="[email protected]";
    String to="<xxx>@apeejaygroup.com";
    ( HERE USING THE ADDRESS AS <xxx>@<rediffmail>.com
    GIVES THE EXCEPTION - javax.mail.SendFailedException: 550 5.7.1 ... Relaying denied )
    Properties props = System.getProperties();
    props.put("mail.smtp.host", host);
    javax.mail.Session session1 = javax.mail.Session.getDefaultInstance
    (props, null);
    MimeMessage message = new MimeMessage(session1);
    message.setFrom(new InternetAddress(from));
    message.addRecipient(Message.RecipientType.TO,new InternetAddress(to));
    message.setSubject("Your Registration Details");
    message.setContent(body,"text/html");
    Transport.send(message);
    Please help me out of this.
    Regards
    Satrajit

    as you said that it might require authentication
    but our mail server doesn't require authentication to mail.
    Now what should i do ??Many servers are now authenticating by requiring you to fetch your e-mail before sending. This is basically because most SMTP mail servers CAN NOT authenticate in the normal sense of the word. So, they use the fetch process for authentication. The fetch process already requires authentication normally. Then your IP address will be good for, say, 20 minutes, and you can relay e-mail through the server.
    It works with most E-mail clients such as Outlook or Netscape, because the default behavior is to 1.Connect to the POP server, 2.Login, 3.Download any new mail, 4.Connect to the SMTP server, 5.Upload any mail to send.
    Even if you don't have any mail, your IP address will at least have been authenticated. Even if you just check for mail, and not download any, you should be OK.
    So what I'd suggest is that you write some code that attempts to connect to your mail system's POP server, get authenticated successfully, then try sending out the e-mail through the SMTP server.

Maybe you are looking for

  • I'm already do the installation of Lookout 4.0.1

    for a telemetrie job with modbus RTU driver.My customer ask me if it's possible to get Data from is existent Endress+Hauser Monorack, with a module ZA672, this module have a RS-232 port, but At this moment I don't event know the protocol they used.An

  • Help please. I've encountered some problem uninstalling my itunes

    This is what it says while trying to uninstall the other version of itunes.

  • MacBook pro hangs at start

    Ok So I did a fresh install of snow leopard on my disk which worked perfectly. But after finding out that all my pro apps mysteriously wouldn't work I decided to restore from a back up when they did. After that restore completed the MacBook hangs on

  • Jscript cross scripting with BSP's

    Hi BSP consultants, I have one BSP embedded in another BSP (actually done using the SEM Web Interface Builder which is a front end for building BSP's in SAP SEM). All I want to do is access the HTML code in the embedded BSP from the parent web page (

  • Copy and past without tiem stamp

    Why isn't this workin? This doesn't work anymore. In Skype 1. Go to Tools > Options > IM & SMS 2. Click "Show advanced options" 3. In "Pressing Ctrl+V will" select "Paste message as plain text" 4. Save